Class SHAMD5PasswordEncoder
java.lang.Object
io.gravitee.am.service.authentication.crypto.password.MessageDigestPasswordEncoder
io.gravitee.am.service.authentication.crypto.password.SHAPasswordEncoder
io.gravitee.am.service.authentication.crypto.password.SHAMD5PasswordEncoder
- All Implemented Interfaces:
PasswordEncoder
- Author:
- Titouan COMPIEGNE (titouan.compiegne at graviteesource.com), GraviteeSource Team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencode(CharSequence rawPassword) Encode the raw password.encode(CharSequence rawPassword, byte[] salt) Encode the raw password.booleanmatches(CharSequence rawPassword, String encodedPassword) Verify the encoded password obtained from storage matches the submitted raw password after it too is encoded.booleanmatches(CharSequence rawPassword, String encodedPassword, byte[] salt) Verify the encoded password obtained from storage matches the submitted raw password after it too is encoded.voidsetEncodeSaltAsBase64(boolean encodeSaltAsBase64) voidsetSaltLength(int saltLength) Methods inherited from class io.gravitee.am.service.authentication.crypto.password.SHAPasswordEncoder
setStrengthMethods inherited from class io.gravitee.am.service.authentication.crypto.password.MessageDigestPasswordEncoder
matches, setAlgorithm, setPasswordSaltFormat
-
Constructor Details
-
SHAMD5PasswordEncoder
public SHAMD5PasswordEncoder() -
SHAMD5PasswordEncoder
-
-
Method Details
-
encode
Description copied from interface:PasswordEncoderEncode the raw password. Generally, a good encoding algorithm applies a SHA-1 or greater hash combined with an 8-byte or greater randomly generated salt.- Specified by:
encodein interfacePasswordEncoder- Overrides:
encodein classMessageDigestPasswordEncoder- Parameters:
rawPassword- the raw password to encode
-
encode
Description copied from interface:PasswordEncoderEncode the raw password. Generally, a good encoding algorithm applies a SHA-1 or greater hash combined with an 8-byte or greater randomly generated salt.- Specified by:
encodein interfacePasswordEncoder- Overrides:
encodein classMessageDigestPasswordEncoder- Parameters:
rawPassword- the raw password to encodesalt- the salt use to encode the rawPassword
-
matches
Description copied from interface:PasswordEncoderVerify the encoded password obtained from storage matches the submitted raw password after it too is encoded. Returns true if the passwords match, false if they do not. The stored password itself is never decoded.- Specified by:
matchesin interfacePasswordEncoder- Overrides:
matchesin classMessageDigestPasswordEncoder- Parameters:
rawPassword- the raw password to encode and matchencodedPassword- the encoded password from storage to compare with- Returns:
- true if the raw password, after encoding, matches the encoded password from storage
-
matches
Description copied from interface:PasswordEncoderVerify the encoded password obtained from storage matches the submitted raw password after it too is encoded. Returns true if the passwords match, false if they do not. The stored password itself is never decoded.- Specified by:
matchesin interfacePasswordEncoder- Overrides:
matchesin classMessageDigestPasswordEncoder- Parameters:
rawPassword- the raw password to encode and matchencodedPassword- the encoded password from storage to compare withsalt- the salt use to compare the rawPassword and the encodedPassword- Returns:
-
setEncodeSaltAsBase64
public void setEncodeSaltAsBase64(boolean encodeSaltAsBase64) - Overrides:
setEncodeSaltAsBase64in classMessageDigestPasswordEncoder
-
setSaltLength
public void setSaltLength(int saltLength) - Overrides:
setSaltLengthin classMessageDigestPasswordEncoder
-