public class PassEncryptUtil
extends java.lang.Object
https://github.com/defuse/password-hashing/blob/master/PasswordStorage.java
Modifier and Type | Class and Description |
---|---|
static class |
PassEncryptUtil.CannotPerformOperationException |
static class |
PassEncryptUtil.InvalidHashException |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createHash(java.lang.String password)
Create a hash of password + salt.
|
static boolean |
verifyPassword(java.lang.String password,
java.lang.String correctHash)
Verify that a password matches a hash.
|
public static java.lang.String createHash(java.lang.String password)
password
- PasswordPassEncryptUtil.CannotPerformOperationException
- If the hash creation failspublic static boolean verifyPassword(java.lang.String password, java.lang.String correctHash)
password
- PasswordcorrectHash
- hash created with createHash(String)
PassEncryptUtil.CannotPerformOperationException
- If hashing failsPassEncryptUtil.InvalidHashException
- If the hash is missing details.