Interface IdentityCredentialPersister
public interface IdentityCredentialPersister
A
CredentialPersister for persisting credentials into LDAP directory.
Implementations of this interface are instantiated for a specific identity, as a result all of the methods on this
interface are specific to that identity.- Author:
- Jan Kalina
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear all supported credentials of identity.<C extends Credential>
CgetCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers) Acquire a credential of the given type.getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers) Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.booleangetCredentialPersistSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) Determine whether a given credential type can be persisted by this credential persister.voidpersistCredential(Credential credential) Store credential of identity.
-
Method Details
-
getCredentialPersistSupport
boolean getCredentialPersistSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec) Determine whether a given credential type can be persisted by this credential persister.- Parameters:
credentialType- the credential type (must not benull)algorithmName- the credential algorithm name, if anyparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parameters- Returns:
trueif persisting of given credential is supported
-
persistCredential
Store credential of identity.- Parameters:
credential- the credential- Throws:
RealmUnavailableException
-
clearCredentials
Clear all supported credentials of identity.- Throws:
RealmUnavailableException
-
getCredentialAcquireSupport
SupportLevel getCredentialAcquireSupport(Class<? extends Credential> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers) Determine whether a given credential is definitely supported, possibly supported, or definitely not supported.- Parameters:
credentialType- the credential type (must not benull)algorithmName- the credential algorithm name, if anyparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parametersproviders- the providers to use when checking ability to obtain the credential- Returns:
- the level of support for this credential type
-
getCredential
<C extends Credential> C getCredential(Class<C> credentialType, String algorithmName, AlgorithmParameterSpec parameterSpec, Supplier<Provider[]> providers) Acquire a credential of the given type.- Type Parameters:
C- the type to which should be credential casted- Parameters:
credentialType- the credential type (must not benull)algorithmName- the credential algorithm name, if anyparameterSpec- the algorithm parameters to match, ornullif any parameters are acceptable or the credential type does not support algorithm parametersproviders- the providers to use when obtaining the credential- Returns:
- the credential, or
nullif the principal has no credential of that name or cannot be casted to that type
-