public final class PBKDF2 extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
check(char[] password,
String correctHash)
Validates a password using a hash.
|
static boolean |
check(String password,
String correctHash)
Validates a password using a hash.
|
static String |
create(HmacAlgorithms alg,
char[] password)
fix salt 16 byte
iterationCount 32
dkLen 32 byte
|
static String |
create(HmacAlgorithms alg,
char[] password,
int saltByteSize,
int iterationCount,
int dkLen)
Returns a salted PBKDF2 hash of the password.
|
static String |
create(HmacAlgorithms alg,
String password) |
static String |
create(String password) |
static byte[] |
pbkdf2(HmacAlgorithms alg,
char[] password,
byte[] salt,
int iterationCount,
int dkLen)
Computes the PBKDF2 hash of a password.
|
public static String create(HmacAlgorithms alg, String password)
public static String create(HmacAlgorithms alg, char[] password)
alg - password - public static String create(HmacAlgorithms alg, char[] password, int saltByteSize, int iterationCount, int dkLen)
alg - HmacAlgorithm, HmacAlgorithm.HmacMD5 is invalidpassword - the password to hashsaltByteSize - the byte length of random slatiterationCount - the iteration count (slowness factor)dkLen - Intended length, in octets, of the derived key.public static boolean check(String password, String correctHash)
password - the password to checkcorrectHash - the hash of the valid passwordpublic static boolean check(char[] password,
String correctHash)
password - the password to checkcorrectHash - the hash of the valid passwordpublic static byte[] pbkdf2(HmacAlgorithms alg, char[] password, byte[] salt, int iterationCount, int dkLen)
alg - the HmacAlgorithmpassword - the password to hashsalt - the saltiterationCount - the iteration count (slowness factor)dkLen - the length of the hash to compute in bytesCopyright © 2023. All rights reserved.