public class KDF3ParameterSpec extends KDF2ParameterSpec
Algorithm parameter specification for the KDF3 Key Derivation Function (KDF).
This class holds all information needed for using the KDF3. This includes the used hash algorithm, the desired key length, the secret value, and the additional information. We use this approach, as the KDF3 is implemented using the KeyGenerator class, and and KeyGenerator.generateKey() is not parameterized.
Constructor and Description |
---|
KDF3ParameterSpec(AlgorithmID hashAlgorithm,
int keyLength)
Creates a new KDF3ParameterSpec for the hash algorithm to be used with KDF3 and
the desired key length.
|
KDF3ParameterSpec(AlgorithmID hashAlgorithm,
int keyLength,
byte[] secretValue)
Creates a new KDF3ParameterSpec for the hash algorithm to be used with KDF3,
the desired key length, and the secret value.
|
KDF3ParameterSpec(AlgorithmID hashAlgorithm,
int keyLength,
byte[] secretValue,
byte[] otherInfo)
Creates a new KDF3ParameterSpec for the hash algorithm to be used with KDF3,
the desired key length, the secret value, and the additional information.
|
Modifier and Type | Method and Description |
---|---|
AlgorithmID |
getAlgorithmId()
Returns the AlgorithmID of the KDF associated with this class.
|
java.lang.String |
getKdf()
Returns the name of the KDF associated with this class.
|
getKeyLength, getOtherInfo, getSecretValue, setKeyLength, setOtherInfo, setSecretValue
getHashAlgorithm, getHashEngine, setHashEngine, toString
getSecureRandom, setSecureRandom
public KDF3ParameterSpec(AlgorithmID hashAlgorithm, int keyLength)
hashAlgorithm
- the hash algorithm IDkeyLength
- the desired key lengthpublic KDF3ParameterSpec(AlgorithmID hashAlgorithm, int keyLength, byte[] secretValue)
hashAlgorithm
- the hash algorithm IDkeyLength
- the desired key lengthsecretValue
- the secret value used for key derivationpublic KDF3ParameterSpec(AlgorithmID hashAlgorithm, int keyLength, byte[] secretValue, byte[] otherInfo)
hashAlgorithm
- the hash algorithm IDkeyLength
- the desired key lengthsecretValue
- the secret value used for key derivationotherInfo
- the additional information for key derivationpublic AlgorithmID getAlgorithmId()
getAlgorithmId
in interface KeyDerivationParameterSpec
getAlgorithmId
in class KDF2ParameterSpec
public java.lang.String getKdf()
getKdf
in interface KeyDerivationParameterSpec
getKdf
in class KDF2ParameterSpec