Package com.unboundid.ldap.listener
Class InMemoryDirectoryServerPassword
java.lang.Object
com.unboundid.ldap.listener.InMemoryDirectoryServerPassword
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class InMemoryDirectoryServerPassword
extends Object
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 Summary
Modifier and TypeMethodDescriptionRetrieves the name of the attribute with which the stored password is associated.Retrieves the clear-text representation of the stored password, if it is possible to obtain it.Retrieves the password encoder that should be used to interact with the stored password.Retrieves the password as it is (or has the potential to be) stored in the in-memory directory server.booleanIndicates whether the stored password is encoded or in the clear.booleanmatchesClearPassword(ASN1OctetString clearPassword) Indicates whether this password matches the provided clear-text password.
-
Method Details
-
getStoredPassword
Retrieves the password as it is (or has the potential to be) stored in the in-memory directory server. If theisEncoded()method returnstrue, 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
Indicates whether the stored password is encoded or in the clear.- Returns:
trueif the stored password is encoded, orfalseif 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
nullif 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 theInMemoryPasswordEncoder.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
Indicates whether this password matches the provided clear-text password.- Parameters:
clearPassword- The clear-text password for which to make the determination.- Returns:
trueif this password matches the provided clear-text password, orfalseif not.- Throws:
LDAPException- If a problem is encountered while trying to make the determination.
-