public final class HKDF extends Object implements KeyDerivationFunction
Implements the HKDF key derivation function according to [1]. References:
[1] RFC 5869, HMAC-based Extract-and-Expand Key Derivation Function (HKDF), see RFC 5869
Constructor and Description |
---|
HKDF()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
engineGenerateKey(byte[] secret)
Derives the symmetric key from a shared secret and returns it.
|
byte[] |
engineGenerateKey(byte[] secret,
int keyLength)
Derives the symmetric key from a shared secret and returns it.
|
void |
engineInit(KDFParameterSpec params)
Initializes this KDF.
|
public void engineInit(KDFParameterSpec params)
KeyDerivationFunction
engineInit
in interface KeyDerivationFunction
params
- the KDF parameterspublic byte[] engineGenerateKey(byte[] secret)
KeyDerivationFunction
engineGenerateKey
in interface KeyDerivationFunction
secret
- the secret, from which the key is going to be derivedpublic byte[] engineGenerateKey(byte[] secret, int keyLength)
KeyDerivationFunction
engineGenerateKey
in interface KeyDerivationFunction
secret
- the secret, from which the key is going to be derivedkeyLength
- the length of the key in bitsCopyright © 2011–2022 Stiftung SIC. All rights reserved.