Class GeneratedPassword
- java.lang.Object
-
- com.unboundid.ldap.sdk.unboundidds.extensions.GeneratedPassword
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class GeneratedPassword extends java.lang.Object implements java.io.Serializable
This class defines a data structure that holds information about a password generated by the server and returned to the client in aGeneratePasswordExtendedResult
.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeneratedPassword(byte[] password, boolean validationAttempted, java.util.List<java.lang.String> validationErrors)
Creates a generated password object with the provided information.GeneratedPassword(java.lang.String password, boolean validationAttempted, java.util.List<java.lang.String> validationErrors)
Creates a generated password object with the provided information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GeneratedPassword
decode(ASN1Element element)
Decodes the provided ASN.1 element as a generated password object.ASN1Sequence
encode()
Encodes this generated password to a sequence suitable for inclusion in the value of aGeneratePasswordExtendedResult
.byte[]
getPasswordBytes()
Retrieves the bytes that comprise the server-generated password.java.lang.String
getPasswordString()
Retrieves a string representation of the server-generated password.java.util.List<java.lang.String>
getValidationErrors()
Retrieves a list of problems identified while the server was validating the quality of the generated password.java.lang.String
toString()
Retrieves a string representation of this generated password object.void
toString(java.lang.StringBuilder buffer)
Appends a string representation of this generated password object to the provided buffer.boolean
validationAttempted()
Indicates whether the server attempted to validate the quality of the generated password.
-
-
-
Constructor Detail
-
GeneratedPassword
public GeneratedPassword(@NotNull java.lang.String password, boolean validationAttempted, @Nullable java.util.List<java.lang.String> validationErrors)
Creates a generated password object with the provided information.- Parameters:
password
- The password that was generated. It must not be @code null} or empty.validationAttempted
- Indicates whether the server attempted to validate the quality of the generated password.validationErrors
- An optional list of messages with information about any problems identified while the server was validating the quality of the generated password.
-
GeneratedPassword
public GeneratedPassword(@NotNull byte[] password, boolean validationAttempted, @Nullable java.util.List<java.lang.String> validationErrors)
Creates a generated password object with the provided information.- Parameters:
password
- The password that was generated. It must not be @code null} or empty.validationAttempted
- Indicates whether the server attempted to validate the quality of the generated password.validationErrors
- An optional list of messages with information about any problems identified while the server was validating the quality of the generated password.
-
-
Method Detail
-
getPasswordString
@NotNull public java.lang.String getPasswordString()
Retrieves a string representation of the server-generated password.- Returns:
- A string representation of the server-generated password.
-
getPasswordBytes
@NotNull public byte[] getPasswordBytes()
Retrieves the bytes that comprise the server-generated password.- Returns:
- The bytes that comprise the server-generated password.
-
validationAttempted
public boolean validationAttempted()
Indicates whether the server attempted to validate the quality of the generated password.- Returns:
true
if the server attempted to validate the quality of the generated password, orfalse
if not.
-
getValidationErrors
@NotNull public java.util.List<java.lang.String> getValidationErrors()
Retrieves a list of problems identified while the server was validating the quality of the generated password.- Returns:
- A list of problems identified while the server was validating the quality of the generated password, or an empty list if no validation was attempted or if the generated password satisfied all of the requirements for all of the appropriate password validators.
-
encode
@NotNull public ASN1Sequence encode()
Encodes this generated password to a sequence suitable for inclusion in the value of aGeneratePasswordExtendedResult
.- Returns:
- An ASN.1 sequence containing an encoded representation of this generated password object.
-
decode
@NotNull public static GeneratedPassword decode(@NotNull ASN1Element element) throws LDAPException
Decodes the provided ASN.1 element as a generated password object.- Parameters:
element
- The ASN.1 element to be decoded. It must not benull
.- Returns:
- The generated password object that was decoded.
- Throws:
LDAPException
- If a problem is encountered while decoding the provided element as a generated password.
-
toString
@NotNull public java.lang.String toString()
Retrieves a string representation of this generated password object.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A string representation of this generated password object.
-
-