Class InMemoryDirectoryServerPassword

java.lang.Object
com.unboundid.ldap.listener.InMemoryDirectoryServerPassword

This class provides a data structure that encapsulates a password used by the in-memory directory server. It may be optionally associated with an InMemoryPasswordEncoder.
  • Method Details

    • getStoredPassword

      Retrieves the password as it is (or has the potential to be) stored in the in-memory directory server. If the isEncoded() method returns true, then the stored password will be treated as an encoded password. Otherwise, it will be treated as a clear-text password with no encoding or output formatting.
      Returns:
      The password as it is (or has the potential to be) stored in the in-memory directory server.
    • getAttributeName

      Retrieves the name of the attribute with which the stored password is associated.
      Returns:
      The name of the attribute with which the stored password is associated.
    • isEncoded

      public boolean isEncoded()
      Indicates whether the stored password is encoded or in the clear.
      Returns:
      true if the stored password is encoded, or false if it is the clear.
    • getPasswordEncoder

      Retrieves the password encoder that should be used to interact with the stored password.
      Returns:
      The password encoder that should be used to interact with the stored password, or null if the password is not encoded.
    • getClearPassword

      Retrieves the clear-text representation of the stored password, if it is possible to obtain it. If the password is not encoded, then the stored password will be returned as-is. If the stored password is encoded, then the InMemoryPasswordEncoder.extractClearPasswordFromEncodedPassword(com.unboundid.asn1.ASN1OctetString, com.unboundid.ldap.sdk.ReadOnlyEntry) method will be used in an attempt to
      Returns:
      The clear-text representation of the stored password.
      Throws:
      LDAPException - If the stored password is encoded using a mechanism that does not permit extracting the clear-text password.
    • matchesClearPassword

      public boolean matchesClearPassword(@NotNull ASN1OctetString clearPassword) throws LDAPException
      Indicates whether this password matches the provided clear-text password.
      Parameters:
      clearPassword - The clear-text password for which to make the determination.
      Returns:
      true if this password matches the provided clear-text password, or false if not.
      Throws:
      LDAPException - If a problem is encountered while trying to make the determination.