Record Class LLPassword
java.lang.Object
java.lang.Record
com.io7m.looseleaf.security.LLPassword
- Record Components:
algorithm- The hash algorithmhash- The hashed passwordsalt- The salt value
public record LLPassword(LLPasswordAlgorithmType algorithm, String hash, String salt)
extends Record
A hashed password for a user.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLLPassword(LLPasswordAlgorithmType algorithm, String hash, String salt) A hashed password for a user. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.booleanCheck the given plain text password against this hashed password.final booleanIndicates whether some other object is "equal to" this one.hash()Returns the value of thehashrecord component.final inthashCode()Returns a hash code value for this object.salt()Returns the value of thesaltrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
VALID_HEX
The pattern that defines a valid hash.
-
-
Constructor Details
-
LLPassword
A hashed password for a user.- Parameters:
algorithm- The hash algorithmhash- The hashed passwordsalt- The salt value
-
-
Method Details
-
check
Check the given plain text password against this hashed password.- Parameters:
passwordText- The plain text password- Returns:
trueiff the password matches- Throws:
LLPasswordException- On com.io7m.looseleaf.cmdline.internal errors such as missing algorithm support- See Also:
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
algorithm
-
hash
-
salt
-