public class BCryptPasswordEncoder extends Object implements PasswordEncoder
| Constructor and Description |
|---|
BCryptPasswordEncoder() |
BCryptPasswordEncoder(int strength) |
BCryptPasswordEncoder(int strength,
SecureRandom random) |
| Modifier and Type | Method and Description |
|---|---|
String |
encode(CharSequence rawPassword)
Encode the raw password.
|
boolean |
matches(CharSequence rawPassword,
String encodedPassword)
Verify the encoded password obtained from storage matches the submitted raw
password after it too is encoded.
|
public BCryptPasswordEncoder()
public BCryptPasswordEncoder(int strength)
strength - the log rounds to usepublic BCryptPasswordEncoder(int strength,
SecureRandom random)
strength - the log rounds to userandom - the secure random instance to usepublic String encode(CharSequence rawPassword)
PasswordEncoderencode in interface PasswordEncoderpublic boolean matches(CharSequence rawPassword, String encodedPassword)
PasswordEncodermatches in interface PasswordEncoderrawPassword - the raw password to encode and matchencodedPassword - the encoded password from storage to compare with