public interface CredentialSource
Modifier and Type | Field and Description |
---|---|
static CredentialSource |
NONE
An empty credential source.
|
Modifier and Type | Method and Description |
---|---|
default <C extends Credential,R> |
applyToCredential(Class<C> credentialType,
Function<C,R> function)
Apply the given function to the acquired credential, if it is set and of the given type.
|
default <C extends Credential,R> |
applyToCredential(Class<C> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec,
Function<C,R> function)
Apply the given function to the acquired credential, if it is set and of the given type and algorithm with the
given parameters.
|
default <C extends Credential,R> |
applyToCredential(Class<C> credentialType,
String algorithmName,
Function<C,R> function)
Apply the given function to the acquired credential, if it is set and of the given type and algorithm.
|
static CredentialSource |
fromSecurityFactory(SecurityFactory<Credential> credentialFactory)
Get a credential source from the given security factory.
|
default <C extends Credential> |
getCredential(Class<C> credentialType)
Acquire a credential of the given type.
|
default <C extends Credential> |
getCredential(Class<C> credentialType,
String algorithmName)
Acquire a credential of the given type.
|
<C extends Credential> |
getCredential(Class<C> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Acquire a credential of the given type.
|
default SupportLevel |
getCredentialAcquireSupport(Class<? extends Credential> credentialType)
Determine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.
|
default SupportLevel |
getCredentialAcquireSupport(Class<? extends Credential> credentialType,
String algorithmName)
Determine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.
|
SupportLevel |
getCredentialAcquireSupport(Class<? extends Credential> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Determine whether a given credential is definitely obtainable, possibly obtainable, or definitely not obtainable.
|
default CredentialSource |
with(CredentialSource other)
Aggregate this credential source with another.
|
default CredentialSource |
without(Class<? extends Credential> credentialType)
Get a derived credential source which excludes credentials of the given type.
|
default CredentialSource |
without(Class<? extends Credential> credentialType,
String algorithmName)
Get a derived credential source which excludes credentials of the given type and optional algorithm.
|
default CredentialSource |
without(Class<? extends Credential> credentialType,
String algorithmName,
AlgorithmParameterSpec parameterSpec)
Get a derived credential source which excludes credentials of the given type and optional algorithm.
|
static final CredentialSource NONE
SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
credentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type does
not support algorithm namesparameterSpec
- the algorithm parameters to match, or null
if any parameters are acceptable or the credential type
does not support algorithm parametersnull
)IOException
- if the credential source failed to determine the support leveldefault SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName) throws IOException
credentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type
does
not support algorithm namesnull
)IOException
- if the credential source failed to determine the support leveldefault SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType) throws IOException
credentialType
- the credential type class (must not be null
)null
)IOException
- if the credential source failed to determine the support level<C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) throws IOException
Class
and an optional algorithmName
. If the
algorithm name is not given, then the query is performed for any algorithm of the given type.C
- the credential typecredentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type does
not support algorithm namesparameterSpec
- the algorithm parameters to match, or null
if any parameters are acceptable or the credential type
does not support algorithm parametersnull
if the principal has no credential of that typeIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault <C extends Credential> C getCredential(Class<C> credentialType, String algorithmName) throws IOException
Class
and an optional
algorithmName
. If the
algorithm name is not given, then the query is performed for any algorithm of the given type.C
- the credential typecredentialType
- the credential type class (must not be null
)algorithmName
- the algorithm name, or null
if any algorithm is acceptable or the credential type
does
not support algorithm namesnull
if the principal has no credential of that typeIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault <C extends Credential> C getCredential(Class<C> credentialType) throws IOException
Class
and an optional
algorithmName
. If the
algorithm name is not given, then the query is performed for any algorithm of the given type.C
- the credential typecredentialType
- the credential type class (must not be null
)null
if the principal has no credential of that typeIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault <C extends Credential,R> R applyToCredential(Class<C> credentialType, Function<C,R> function) throws IOException
C
- the credential typeR
- the return typecredentialType
- the credential type class (must not be null
)function
- the function to apply (must not be null
)null
if the criteria are not metIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault <C extends Credential,R> R applyToCredential(Class<C> credentialType, String algorithmName, Function<C,R> function) throws IOException
C
- the credential typeR
- the return typecredentialType
- the credential type class (must not be null
)algorithmName
- the algorithm namefunction
- the function to apply (must not be null
)null
if the criteria are not metIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault <C extends Credential,R> R applyToCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Function<C,R> function) throws IOException
C
- the credential typeR
- the return typecredentialType
- the credential type class (must not be null
)algorithmName
- the algorithm nameparameterSpec
- the parameter specification or null
if any parameter specification is acceptablefunction
- the function to apply (must not be null
)null
if the criteria are not metIOException
- if the realm is not able to handle requests for any reasonIllegalStateException
- if no authentication has been initiated or authentication is already completeddefault CredentialSource with(CredentialSource other)
other
- the other credential source (must not be null
)null
)default CredentialSource without(Class<? extends Credential> credentialType)
credentialType
- the credential type to exclude (must not be null
)null
)default CredentialSource without(Class<? extends Credential> credentialType, String algorithmName)
credentialType
- the credential type to exclude (must not be null
)algorithmName
- the algorithm name to exclude, or null
to exclude all algorithms (or for credential types which do not use algorithms)null
)default CredentialSource without(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec)
credentialType
- the credential type to exclude (must not be null
)algorithmName
- the algorithm name to exclude, or null
to exclude all algorithms (or for credential types which do not use algorithms)parameterSpec
- the parameter specification or null
if any parameter specification is acceptablenull
)static CredentialSource fromSecurityFactory(SecurityFactory<Credential> credentialFactory)
OneTimeSecurityFactory
.credentialFactory
- the credential factory (must not be null
)null
)Copyright © 2017 JBoss by Red Hat. All rights reserved.