Package com.djrapitops.plan.utilities
Class PassEncryptUtil
java.lang.Object
com.djrapitops.plan.utilities.PassEncryptUtil
Password Encryption utility.
https://github.com/defuse/password-hashing/blob/master/PasswordStorage.java
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createHash
(String password) Create a hash of password + salt.static boolean
verifyPassword
(String password, String correctHash) Verify that a password matches a hash.
-
Method Details
-
createHash
Create a hash of password + salt.- Parameters:
password
- Password- Returns:
- Hash + salt
- Throws:
PassEncryptUtil.CannotPerformOperationException
- If the hash creation fails
-
verifyPassword
Verify that a password matches a hash.- Parameters:
password
- PasswordcorrectHash
- hash created withcreateHash(String)
- Returns:
- true if match
- Throws:
PassEncryptUtil.CannotPerformOperationException
- If hashing failsPassEncryptUtil.InvalidHashException
- If the hash is missing details.
-