public class JBCryptPasswordEncoder extends java.lang.Object implements PasswordEncoder
jBcrypt dependency to use this class.| Constructor and Description |
|---|
JBCryptPasswordEncoder()
Use the default salt generated by
BCrypt.gensalt(). |
JBCryptPasswordEncoder(java.lang.String salt) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
encode(java.lang.String password)
Encode a password.
|
java.lang.String |
getSalt() |
boolean |
matches(java.lang.String plainPassword,
java.lang.String encodedPassword)
Validate if a plainPassword matches
|
void |
setSalt(java.lang.String salt) |
public JBCryptPasswordEncoder(java.lang.String salt)
salt - the salt to hash with (perhaps generated using BCrypt.gensalt())BCryptpublic JBCryptPasswordEncoder()
BCrypt.gensalt().public java.lang.String encode(java.lang.String password)
PasswordEncoderencode in interface PasswordEncoderpassword - the not encoded passwordpublic boolean matches(java.lang.String plainPassword,
java.lang.String encodedPassword)
PasswordEncodermatches in interface PasswordEncoderplainPassword - the not encoded password to checkencodedPassword - the encoded passwordtrue if they matchpublic java.lang.String getSalt()
public void setSalt(java.lang.String salt)
salt - the salt to hash with (perhaps generated using BCrypt.gensalt())BCryptCopyright © 2019. All Rights Reserved.