Package com.unboundid.ldap.listener
Class HexPasswordEncoderOutputFormatter
- java.lang.Object
-
- com.unboundid.ldap.listener.PasswordEncoderOutputFormatter
-
- com.unboundid.ldap.listener.HexPasswordEncoderOutputFormatter
-
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class HexPasswordEncoderOutputFormatter extends PasswordEncoderOutputFormatter
This class provides an implementation of a password encoder output formatter that will use hexadecimal digits to represent the bytes of the encoded password.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]format(byte[] unformattedData)Formats the provided data in accordance with this output format.static HexPasswordEncoderOutputFormattergetLowercaseInstance()Retrieves a singleton instance of this hex password encoder that will represent the hexadecimal digits 'A' through 'F' as lowercase letters.static HexPasswordEncoderOutputFormattergetUppercaseInstance()Retrieves a singleton instance of this hex password encoder that will represent the hexadecimal digits 'A' through 'F' as uppercase letters.voidtoString(java.lang.StringBuilder buffer)Appends a string representation of this password encoder output formatter to the provided buffer.byte[]unFormat(byte[] formattedData)Reverses the formatting that has been applied to the provided data.booleanuseLowercaseLetters()Indicates whether to represent the hexadecimal digits 'A' through 'F' as lowercase letters or uppercase letters.-
Methods inherited from class com.unboundid.ldap.listener.PasswordEncoderOutputFormatter
toString
-
-
-
-
Method Detail
-
getLowercaseInstance
@NotNull public static HexPasswordEncoderOutputFormatter getLowercaseInstance()
Retrieves a singleton instance of this hex password encoder that will represent the hexadecimal digits 'A' through 'F' as lowercase letters.- Returns:
- The hex password encoder instance.
-
getUppercaseInstance
@NotNull public static HexPasswordEncoderOutputFormatter getUppercaseInstance()
Retrieves a singleton instance of this hex password encoder that will represent the hexadecimal digits 'A' through 'F' as uppercase letters.- Returns:
- The hex password encoder instance.
-
useLowercaseLetters
public boolean useLowercaseLetters()
Indicates whether to represent the hexadecimal digits 'A' through 'F' as lowercase letters or uppercase letters. Note that this setting only applies when formatting an encoded password. When un-formatting a password, either uppercase or lowercase letters will be properly handled.- Returns:
trueif hexadecimal digits 'A' through 'F' should be represented as lowercase letters, orfalseif they should be represented as uppercase letters.
-
format
@NotNull public byte[] format(@NotNull byte[] unformattedData) throws LDAPException
Formats the provided data in accordance with this output format.- Specified by:
formatin classPasswordEncoderOutputFormatter- Parameters:
unformattedData- The data to be formatted. It must not benull.- Returns:
- A formatted representation of the provided data.
- Throws:
LDAPException- If a problem is encountered while formatting the provided data.
-
unFormat
@NotNull public byte[] unFormat(@NotNull byte[] formattedData) throws LDAPException
Reverses the formatting that has been applied to the provided data.- Specified by:
unFormatin classPasswordEncoderOutputFormatter- Parameters:
formattedData- The formatted data to be un-formatted. It must not benull.- Returns:
- The un-formatted version of the provided data.
- Throws:
LDAPException- If the provided data does not represent a valid encoding, or if a problem is encountered while un-formatting the provided data.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this password encoder output formatter to the provided buffer.- Specified by:
toStringin classPasswordEncoderOutputFormatter- Parameters:
buffer- The buffer to which the information should be appended.
-
-