Module io.inverno.mod.security
Interface Password.Encoder<A extends Password<A,B>,B extends Password.Encoder<A,B>>
- Type Parameters:
A- the password typeB- the password encoder type
- All Known Implementing Classes:
Argon2Password.Encoder,BCryptPassword.Encoder,DigestPassword.Encoder,MessageDigestPassword.Encoder,PBKDF2Password.Encoder,RawPassword.Encoder,SCryptPassword.Encoder
public static interface Password.Encoder<A extends Password<A,B>,B extends Password.Encoder<A,B>>
A password encoder used to encode a raw password into a secured password representation.
-
Method Summary
Modifier and TypeMethodDescriptionEncodes the specified raw password.default booleanMatches the specified passwords.booleanMatches the specified raw password with the specified encoded representation.Recovers a password from its encoded representation generated with this encoder.
-
Method Details
-
recover
Recovers a password from its encoded representation generated with this encoder.
- Parameters:
encoded- an encoded password representation- Returns:
- a password
- Throws:
PasswordException- if there was an error recovering the password or if the specified encoded representation was not generated with this encoder
-
encode
Encodes the specified raw password.
- Parameters:
raw- a raw password- Returns:
- an encoded password
- Throws:
PasswordException- if there was an error encoding the password
-
matches
Matches the specified raw password with the specified encoded representation.
- Parameters:
raw- a raw passwordencoded- an encoded password- Returns:
- true if passwords match, false otherwise
- Throws:
PasswordException- if there was an error matching passwords
-
matches
Matches the specified passwords.
- Parameters:
password- a passwordother- another password- Returns:
- true if passwords match, false otherwise
- Throws:
PasswordException- if there was an error matching passwords or if passwords are of incompatible types
-