public class PBKDF2Hash
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ITERATION_INDEX |
static int |
PBKDF2_INDEX |
static int |
SALT_INDEX |
Constructor and Description |
---|
PBKDF2Hash() |
PBKDF2Hash(int saltBytes,
int hashBytes,
int iterations) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createHash(char[] password)
Returns a salted PBKDF2 hash of the password.
|
java.lang.String |
createHash(java.lang.String password)
Returns a salted PBKDF2 hash of the password.
|
boolean |
validatePassword(char[] password,
java.lang.String goodHash)
Validates a password using a hash.
|
boolean |
validatePassword(java.lang.String password,
java.lang.String goodHash)
Validates a password using a hash.
|
public static final int ITERATION_INDEX
public static final int SALT_INDEX
public static final int PBKDF2_INDEX
public PBKDF2Hash()
public PBKDF2Hash(int saltBytes, int hashBytes, int iterations)
public java.lang.String createHash(java.lang.String password)
password
- the password to hashpublic java.lang.String createHash(char[] password)
password
- the password to hashpublic boolean validatePassword(java.lang.String password, java.lang.String goodHash)
password
- the password to checkgoodHash
- the hash of the valid passwordpublic boolean validatePassword(char[] password, java.lang.String goodHash)
password
- the password to checkgoodHash
- the hash of the valid passwordCopyright © 2003-present Jodd Team