| Modifier and Type | Field and Description |
|---|---|
static int |
MIN_SALT_LENGTH
The minimum salt length (8 bytes).
|
| 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 final int MIN_SALT_LENGTH
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 be at least 8 bytes long.JOSEException - If formatting failed.public 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 a positive
integer.prfParams - The Pseudo-Random Function (PRF) parameters.
Must not be null.JOSEException - If the key derivation failed.Copyright © 2021 Connect2id Ltd.. All rights reserved.