public class SaltCredentialTool
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
generateHash(java.lang.String password)
Method used for new passwords
|
static boolean |
verifyPassword(java.lang.String password,
java.lang.String hash)
Verifies if a password is correct
|
public static java.lang.String generateHash(@Nonnull java.lang.String password)
Method used for new passwords
password
- password to be salted and hashedjava.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException
public static boolean verifyPassword(@Nonnull java.lang.String password, @Nonnull java.lang.String hash)
Verifies if a password is correct
password
- the proposed passwordhash
- the original hash in form of hash:saltjava.security.NoSuchAlgorithmException
java.security.spec.InvalidKeySpecException