This class implements the HKDF-Extract and HKDF-Expand functions from RFC 5869. This implementation provides the complete Extract-then-Expand HKDF function as well as Extract-only and Expand-only variants.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | HKDFKeyDerivation(HKDFKeyDerivation.
the initialization parameters (may be kdfParameters)null)The sole constructor. |
| Modifier and Type | Method and Description |
|---|---|
| private byte[] | |
| protected byte[] | Returns: a derivedbyte[]Implements abstract javax. Obtain raw data from a key derivation function. |
| protected SecretKey | Returns: a derivedSecretKey object of the specified algorithmImplements abstract javax. Derive a key, returned as a |
| protected KDFParameters | engineGetParameters()
Implements abstract javax. Returns the |
| private byte[] | Returns: a byte array containing the completeKDF output. This
will be at least as long as the requested length in the
outLen parameter, but will be rounded up to the nearest
multiple of the HMAC output length.the pseudorandom key used for HKDF-Expand prk, byte[] optional context and application specific information or
info, int null if no info data is provided.the length in bytes of the required output outLen)Perform the HKDF-Expand operation. |
| private byte[] | Returns: a byte array containing the pseudorandom key (PRK)the input keying material used for the HKDF-Extract operation. inputKeyMaterial, byte[] the salt value used for HKDF-Extract salt)Perform the HKDF-Extract operation. |
| hmacAlgName | back to summary |
|---|---|
| private final String hmacAlgName | |
| hmacLen | back to summary |
|---|---|
| private final int hmacLen | |
| HKDFKeyDerivation | back to summary |
|---|---|
| private HKDFKeyDerivation(HKDFKeyDerivation. The sole constructor.
| |
| consolidateKeyMaterial | back to summary |
|---|---|
| private byte[] consolidateKeyMaterial(List<SecretKey> keys) throws InvalidKeyException | |
| engineDeriveData | back to summary |
|---|---|
| protected byte[] engineDeriveData(AlgorithmParameterSpec derivationSpec) throws InvalidAlgorithmParameterException Implements abstract javax. Obtain raw data from a key derivation function.
| |
| engineDeriveKey | back to summary |
|---|---|
| protected SecretKey engineDeriveKey(String alg, AlgorithmParameterSpec derivationSpec) throws InvalidAlgorithmParameterException, NoSuchAlgorithmException Implements abstract javax. Derive a key, returned as a
| |
| engineGetParameters | back to summary |
|---|---|
| protected KDFParameters engineGetParameters() Implements abstract javax. Doc from javax. Returns the
The returned parameters may be the same that were used to initialize
this | |
| hkdfExpand | back to summary |
|---|---|
| private byte[] hkdfExpand(byte[] prk, byte[] info, int outLen) throws InvalidKeyException, NoSuchAlgorithmException Perform the HKDF-Expand operation.
| |
| hkdfExtract | back to summary |
|---|---|
| private byte[] hkdfExtract(byte[] inputKeyMaterial, byte[] salt) throws InvalidKeyException, NoSuchAlgorithmException Perform the HKDF-Extract operation.
| |
| Access | Constructor and Description |
|---|---|
| public |
| HKDFSHA256 | back to summary |
|---|---|
| public HKDFSHA256(KDFParameters kdfParameters) throws InvalidAlgorithmParameterException | |
| Access | Constructor and Description |
|---|---|
| public |
| HKDFSHA384 | back to summary |
|---|---|
| public HKDFSHA384(KDFParameters kdfParameters) throws InvalidAlgorithmParameterException | |
| Access | Constructor and Description |
|---|---|
| public |
| HKDFSHA512 | back to summary |
|---|---|
| public HKDFSHA512(KDFParameters kdfParameters) throws InvalidAlgorithmParameterException | |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final int | |
| public static final HKDFKeyDerivation. | |
| public static final HKDFKeyDerivation. | |
| public static final HKDFKeyDerivation. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HKDFKeyDerivation. | |
| public static HKDFKeyDerivation. |
| hmacAlg | back to summary |
|---|---|
| private final String hmacAlg | |
| hmacLen | back to summary |
|---|---|
| private final int hmacLen | |
| SHA256 | back to summary |
|---|---|
| public static final HKDFKeyDerivation. | |
| SHA384 | back to summary |
|---|---|
| public static final HKDFKeyDerivation. | |
| SHA512 | back to summary |
|---|---|
| public static final HKDFKeyDerivation. | |
| SupportedHmac | back to summary |
|---|---|
| private SupportedHmac(String hmacAlg, int hmacLen) | |
| valueOf | back to summary |
|---|---|
| public static HKDFKeyDerivation. | |
| values | back to summary |
|---|---|
| public static HKDFKeyDerivation. | |