Package com.djrapitops.plan.utilities
Class PassEncryptUtil
java.lang.Object
com.djrapitops.plan.utilities.PassEncryptUtil
Password Encryption utility.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateHash(String password) Create a hash of password + salt.static booleanverifyPassword(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.
-