@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class AES256EncodedPasswordSecretKey extends java.lang.Object implements java.io.Serializable
AES256EncodedPassword
objects. Reusing a secret key avoids the (potentially significant) cost of
generating it for each encryption and decryption operation.
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.
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroys this secret key.
|
static AES256EncodedPasswordSecretKey |
generate(byte[] encryptionSettingsDefinitionID,
char[] encryptionSettingsDefinitionPassphrase)
Generates an AES256 secret key from the provided information.
|
static AES256EncodedPasswordSecretKey |
generate(byte[] encryptionSettingsDefinitionID,
char[] encryptionSettingsDefinitionPassphrase,
byte[] keyFactorySalt)
Generates an AES256 secret key from the provided information.
|
static AES256EncodedPasswordSecretKey |
generate(java.lang.String encryptionSettingsDefinitionID,
java.lang.String encryptionSettingsDefinitionPassphrase)
Generates an AES256 secret key from the provided information.
|
byte[] |
getEncryptionSettingsDefinitionID()
Retrieves the bytes that comprise the raw identifier for the encryption
settings definition whose passphrase was used to generate the secret key.
|
byte[] |
getKeyFactorySalt()
Retrieves the salt used to generate the secret key from the encryption
settings definition passphrase.
|
javax.crypto.SecretKey |
getSecretKey()
Retrieves the secret key that was generated.
|
java.lang.String |
toString()
Retrieves a string representation of this AES256 encoded password secret
key.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this AES256 encoded password secret key
to the provided buffer.
|
@NotNull public static AES256EncodedPasswordSecretKey generate(@NotNull java.lang.String encryptionSettingsDefinitionID, @NotNull java.lang.String encryptionSettingsDefinitionPassphrase) throws java.security.GeneralSecurityException, java.text.ParseException
encryptionSettingsDefinitionID
- A string with the hexadecimal representation of the
encryption settings definition whose passphrase was used to
generate the encoded password. It must not be
null
or empty, and it must represent a valid
hexadecimal string whose length is an even number less than
or equal to 510 bytes.encryptionSettingsDefinitionPassphrase
- The passphrase associated with the specified encryption
settings definition. It must not be null
or empty.java.security.GeneralSecurityException
- If a problem occurs while trying to
generate the secret key.java.text.ParseException
- If the provided encryption settings ID cannot be
parsed as a hexadecimal string.@NotNull public static AES256EncodedPasswordSecretKey generate(@NotNull byte[] encryptionSettingsDefinitionID, @NotNull char[] encryptionSettingsDefinitionPassphrase) throws java.security.GeneralSecurityException
encryptionSettingsDefinitionID
- The bytes that comprise the raw encryption settings definition
ID whose passphrase was used to generate the encoded password.
It must not be null
or empty, and its length must be
less than or equal to 255 bytes.encryptionSettingsDefinitionPassphrase
- The passphrase associated with the specified encryption
settings definition. It must not be null
or empty.java.security.GeneralSecurityException
- If a problem occurs while trying to
generate the secret key.@NotNull public static AES256EncodedPasswordSecretKey generate(@NotNull byte[] encryptionSettingsDefinitionID, @NotNull char[] encryptionSettingsDefinitionPassphrase, @NotNull byte[] keyFactorySalt) throws java.security.GeneralSecurityException
encryptionSettingsDefinitionID
- The bytes that comprise the raw encryption settings definition
ID whose passphrase was used to generate the encoded password.
It must not be null
or empty, and its length must be
less than or equal to 255 bytes.encryptionSettingsDefinitionPassphrase
- The passphrase associated with the specified encryption
settings definition. It must not be null
or empty.keyFactorySalt
- The salt used to generate the encryption key from the
encryption settings definition passphrase. It must not be
null
and it must have a length of exactly 16 bytes.java.security.GeneralSecurityException
- If a problem occurs while trying to
generate the secret key.@NotNull public byte[] getEncryptionSettingsDefinitionID()
@NotNull public byte[] getKeyFactorySalt()
@NotNull public javax.crypto.SecretKey getSecretKey()
destroy()
method has been called.public void destroy()
@NotNull public java.lang.String toString()
toString
in class java.lang.Object