Interface PasswordEncoder

All Superinterfaces:
Serializable
All Known Implementing Classes:
GenericSaltedPasswordEncoder, MD5PasswordEncoder, PBKDF2WithHmacSHA1SaltedPasswordEncoder, PKbasedSaltedMD5PasswordEncoder, PlainTextPasswordEncoder, SaltedMD5PasswordEncoder, SaltedPasswordEncoder, SHA1PasswordEncoder

public interface PasswordEncoder extends Serializable
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    check(String uid, String encoded, String plain)
    Checks if the encoded password (from the user, from the database) and the plain password (from the login screen) matches.
    decode(String encoded)
    Decode the given encoded password.
    encode(String uid, String plain)
    Returns the encoded password string based on the implementation of this interface and by the given plain password.
  • Method Details

    • encode

      String encode(String uid, String plain)
      Returns the encoded password string based on the implementation of this interface and by the given plain password. The uid can be used as additional salt (see SaltedMD5PasswordEncoder).
      Parameters:
      uid - mostly userID, mostly not used
      plain - the plain password
      Returns:
      the encoded password
      See Also:
    • check

      boolean check(String uid, String encoded, String plain)
      Checks if the encoded password (from the user, from the database) and the plain password (from the login screen) matches.
      Parameters:
      uid - mostly the user ID and mostly not used. For MD5 used as salt.
      encoded - the encoded password
      plain - the plain text password
      Returns:
      true if they match, false otherwise.
      See Also:
    • decode

      Decode the given encoded password. 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: