Interface PasswordEncoder
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
GenericSaltedPasswordEncoder,MD5PasswordEncoder,PBKDF2WithHmacSHA1SaltedPasswordEncoder,PKbasedSaltedMD5PasswordEncoder,PlainTextPasswordEncoder,SaltedMD5PasswordEncoder,SaltedPasswordEncoder,SHA1PasswordEncoder
public interface PasswordEncoder extends java.io.Serializable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheck(java.lang.String uid, java.lang.String encoded, java.lang.String plain)Checks if theencodedpassword (from the user, from the database) and theplainpassword (from the login screen) matches.java.lang.Stringdecode(java.lang.String encoded)Decode the givenencodedpassword.java.lang.Stringencode(java.lang.String uid, java.lang.String plain)Returns the encoded password string based on the implementation of this interface and by the givenplainpassword.
-
-
-
Method Detail
-
encode
java.lang.String encode(java.lang.String uid, java.lang.String plain)Returns the encoded password string based on the implementation of this interface and by the givenplainpassword. The uid can be used as additional salt (see SaltedMD5PasswordEncoder).- Parameters:
uid- mostly userID, mostly not usedplain- the plain password- Returns:
- the encoded password
- See Also:
SaltedMD5PasswordEncoder,PlainTextPasswordEncoder
-
check
boolean check(java.lang.String uid, java.lang.String encoded, java.lang.String plain)Checks if theencodedpassword (from the user, from the database) and theplainpassword (from the login screen) matches.- Parameters:
uid- mostly the user ID and mostly not used. For MD5 used as salt.encoded- the encoded passwordplain- the plain text password- Returns:
trueif they match,falseotherwise.- See Also:
MD5PasswordEncoder
-
decode
java.lang.String decode(java.lang.String encoded) throws EJBCannotDecodePasswordExceptionDecode the givenencodedpassword. Throws exception if this is not possible.- Parameters:
encoded- the encoded password- Returns:
- the decoded password
- Throws:
EJBCannotDecodePasswordException- if the password cannot be decoded. (MD5 passwords cannot be decoded)- See Also:
MD5PasswordEncoder
-
-