Interface PasswordEncoder

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean check​(java.lang.String uid, java.lang.String encoded, java.lang.String plain)
      Checks if the encoded password (from the user, from the database) and the plain password (from the login screen) matches.
      java.lang.String decode​(java.lang.String encoded)
      Decode the given encoded password.
      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 given plain password.
    • 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 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:
        SaltedMD5PasswordEncoder, PlainTextPasswordEncoder
      • check

        boolean check​(java.lang.String uid,
                      java.lang.String encoded,
                      java.lang.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:
        MD5PasswordEncoder