Package com.io7m.idstore.model
Class IdPasswordAlgorithmRedacted
java.lang.Object
com.io7m.idstore.model.IdPasswordAlgorithmRedacted
- All Implemented Interfaces:
IdPasswordAlgorithmType
A "redacted" hashing algorithm used to represent passwords that should not be
returned to users/admins.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the given plain text password matches the expected hash.static IdPasswordAlgorithmRedacted
create()
Create an algorithm with the given iteration count and key length.createHashed
(String passwordText, byte[] salt) Create a hashed password.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.io7m.idstore.model.IdPasswordAlgorithmType
createHashed
-
Method Details
-
create
Create an algorithm with the given iteration count and key length.- Returns:
- An algorithm
-
check
Description copied from interface:IdPasswordAlgorithmType
Check if the given plain text password matches the expected hash.- Specified by:
check
in interfaceIdPasswordAlgorithmType
- Parameters:
expectedHash
- The expected hexadecimal uppercase hashreceivedPassword
- The received plain text passwordsalt
- The salt value- Returns:
true
if the password matches
-
createHashed
Description copied from interface:IdPasswordAlgorithmType
Create a hashed password.- Specified by:
createHashed
in interfaceIdPasswordAlgorithmType
- Parameters:
passwordText
- The plain text passwordsalt
- A random salt value- Returns:
- A hashed password
-
identifier
- Specified by:
identifier
in interfaceIdPasswordAlgorithmType
- Returns:
- The password algorithm identifier
-