Class Pbkdf2Sha256PasswordEncoder
java.lang.Object
com.codename1.backend.security.crypto.Pbkdf2Sha256PasswordEncoder
- All Implemented Interfaces:
PasswordEncoder
PBKDF2-HMAC-SHA256 through the runtime's own Crypto.hashPassword(String) and
Crypto.verifyPassword(String, String): a random salt per password, and the round count
written into the result, so a stored value says how it is to be checked.
pbkdf2$210000$<salt>$<hash>
Registered as {pbkdf2-sha256}, the scheme new passwords get. It is not the
format of Spring's Pbkdf2PasswordEncoder; Pbkdf2PasswordEncoder reads
that one's {pbkdf2} hashes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencode(CharSequence rawPassword) The password as it should be stored: salted and hashed, so encoding one password twice gives two different results.booleanmatches(CharSequence rawPassword, String encodedPassword) WhetherrawPasswordis the passwordencodedPasswordwas made from.booleanupgradeEncoding(String encodedPassword) True when the stored password was made with fewer rounds than passwords get now.
-
Constructor Details
-
Pbkdf2Sha256PasswordEncoder
public Pbkdf2Sha256PasswordEncoder()
-
-
Method Details
-
encode
Description copied from interface:PasswordEncoderThe password as it should be stored: salted and hashed, so encoding one password twice gives two different results.- Specified by:
encodein interfacePasswordEncoder
-
matches
Description copied from interface:PasswordEncoderWhetherrawPasswordis the passwordencodedPasswordwas made from.- Specified by:
matchesin interfacePasswordEncoder
-
upgradeEncoding
True when the stored password was made with fewer rounds than passwords get now.- Specified by:
upgradeEncodingin interfacePasswordEncoder
-