public final class Hkdf extends Object
| Modifier and Type | Method and Description |
|---|---|
byte[] |
deriveKey(byte[] info,
int length) |
void |
deriveKey(byte[] info,
int length,
byte[] output,
int offset) |
byte[] |
deriveKey(String info,
int length) |
static Hkdf |
getInstance(String algorithm)
Returns an new instance
|
void |
init(byte[] ikm) |
void |
init(byte[] ikm,
byte[] salt) |
void |
unsafeInitWithoutKeyExtraction(SecretKey rawKey) |
public static Hkdf getInstance(String algorithm) throws NoSuchAlgorithmException
algorithm - the crypto algorithmHkdfNoSuchAlgorithmExceptionpublic void init(byte[] ikm)
ikm - REQUIRED: The input key material.public void init(byte[] ikm,
byte[] salt)
ikm - REQUIRED: The input key material.salt - REQUIRED: Random bytes for salt.public void unsafeInitWithoutKeyExtraction(SecretKey rawKey) throws InvalidKeyException
rawKey - REQUIRED: Current secret key.InvalidKeyExceptionpublic byte[] deriveKey(String info, int length)
info - REQUIREDlength - REQUIREDpublic byte[] deriveKey(byte[] info,
int length)
info - REQUIREDlength - REQUIREDpublic void deriveKey(byte[] info,
int length,
byte[] output,
int offset)
throws ShortBufferException
info - REQUIREDlength - REQUIREDoutput - REQUIREDoffset - REQUIREDShortBufferExceptionCopyright © 2020. All rights reserved.