public class BCryptPasswordEncoder extends java.lang.Object implements PasswordEncoder
| Constructor and Description |
|---|
BCryptPasswordEncoder() |
BCryptPasswordEncoder(int strength) |
BCryptPasswordEncoder(int strength,
java.security.SecureRandom random) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
encode(java.lang.CharSequence rawPassword)
Encode the raw password.
|
boolean |
matches(java.lang.CharSequence rawPassword,
java.lang.String encodedPassword)
Verify the encoded password obtained from storage matches the submitted raw
password after it too is encoded.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitupgradeEncodingpublic BCryptPasswordEncoder()
public BCryptPasswordEncoder(int strength)
strength - the log rounds to use, between 4 and 31public BCryptPasswordEncoder(int strength,
java.security.SecureRandom random)
strength - the log rounds to use, between 4 and 31random - the secure random instance to usepublic java.lang.String encode(java.lang.CharSequence rawPassword)
PasswordEncoderencode in interface PasswordEncoderpublic boolean matches(java.lang.CharSequence rawPassword,
java.lang.String encodedPassword)
PasswordEncodermatches in interface PasswordEncoderrawPassword - the raw password to encode and matchencodedPassword - the encoded password from storage to compare with