| Modifier and Type | Field and Description |
|---|---|
static byte[] |
ZERO_BYTE
Zero byte array of length one.
|
| Modifier and Type | Method and Description |
|---|---|
static SecretKey |
deriveKey(byte[] password,
byte[] formattedSalt,
int iterationCount,
PRFParams prfParams)
Derives a PBKDF2 key from the specified password and parameters.
|
static byte[] |
formatSalt(JWEAlgorithm alg,
byte[] salt)
Formats the specified cryptographic salt for use in PBKDF2.
|
public static byte[] ZERO_BYTE
public static byte[] formatSalt(JWEAlgorithm alg, byte[] salt) throws JOSEException
UTF8(JWE-alg) || 0x00 || Salt Input
alg - The JWE algorithm. Must not be null.salt - The cryptographic salt. Must not be empty or null.JOSEExceptionpublic static SecretKey deriveKey(byte[] password, byte[] formattedSalt, int iterationCount, PRFParams prfParams) throws JOSEException
password - The password. Must not be null.formattedSalt - The formatted cryptographic salt. Must not be
null.iterationCount - The iteration count. Must be positive.prfParams - The Pseudo-Random Function (PRF) parameters.
Must not be null.JOSEException - If the key derivation failed.Copyright © 2020 Connect2id Ltd.. All rights reserved.