Package com.io7m.looseleaf.security
Interface LLPasswordAlgorithmType
- All Known Implementing Classes:
LLPasswordAlgorithmPBKDF2HmacSHA256
The type of password hashing algorithms.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the given plain text password matches the expected hash.default LLPasswordcreateHashed(String passwordText) Create a hashed password with a random salt.createHashed(String passwordText, byte[] salt) Create a hashed password.
-
Method Details
-
check
Check if the given plain text password matches the expected hash.- Parameters:
expectedHash- The expected hexadecimal uppercase hashreceivedPassword- The received plain text passwordsalt- The salt value- Returns:
trueif the password matches- Throws:
LLPasswordException- On com.io7m.looseleaf.cmdline.internal errors such as missing algorithm support
-
createHashed
Create a hashed password.- Parameters:
passwordText- The plain text passwordsalt- A random salt value- Returns:
- A hashed password
- Throws:
LLPasswordException- On com.io7m.looseleaf.cmdline.internal errors such as missing algorithm support
-
createHashed
Create a hashed password with a random salt.- Parameters:
passwordText- The plain text password- Returns:
- A hashed password
- Throws:
LLPasswordException- On com.io7m.looseleaf.cmdline.internal errors such as missing algorithm support
-
identifier
String identifier()- Returns:
- The password algorithm identifier
-