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 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 be null)
      algorithmName - the credential algorithm name, if any
      parameterSpec - the algorithm parameters to match, or null if any parameters are acceptable or the credential type does not support algorithm parameters
      Returns:
      true if persisting of given credential is supported
    • persistCredential

      void persistCredential(Credential credential) throws RealmUnavailableException
      Store credential of identity.
      Parameters:
      credential - the credential
      Throws:
      RealmUnavailableException
    • clearCredentials

      void clearCredentials() throws RealmUnavailableException
      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 be null)
      algorithmName - the credential algorithm name, if any
      parameterSpec - the algorithm parameters to match, or null if any parameters are acceptable or the credential type does not support algorithm parameters
      providers - 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 be null)
      algorithmName - the credential algorithm name, if any
      parameterSpec - the algorithm parameters to match, or null if any parameters are acceptable or the credential type does not support algorithm parameters
      providers - the providers to use when obtaining the credential
      Returns:
      the credential, or null if the principal has no credential of that name or cannot be casted to that type