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