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()
)BCrypt
public JBCryptPasswordEncoder()
BCrypt.gensalt()
.public String encode(String password)
PasswordEncoder
encode
in interface PasswordEncoder
password
- the not encoded passwordpublic boolean matches(String plainPassword, String encodedPassword)
PasswordEncoder
matches
in interface PasswordEncoder
plainPassword
- 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()
)BCrypt
Copyright © 2019. All rights reserved.