Interface PasswordHashHelper.PasswordEncoder

All Known Implementing Classes:
PasswordHashHelper.BcryptPasswordEncoder
Enclosing class:
PasswordHashHelper

protected static interface PasswordHashHelper.PasswordEncoder
Internal encoder abstraction. Kept package-private/inner to avoid leaking public API surface.
  • Method Summary

    Modifier and Type
    Method
    Description
    encode(String rawPassword)
    Encodes the raw password.
    boolean
    matches(String rawPassword, String encodedPassword)
    Verifies the raw password against the encoded hash.
  • Method Details

    • encode

      String encode(String rawPassword)
      Encodes the raw password.
      Parameters:
      rawPassword - the plain-text password
      Returns:
      the encoded hash (without any {id} prefix)
    • matches

      boolean matches(String rawPassword, String encodedPassword)
      Verifies the raw password against the encoded hash.
      Parameters:
      rawPassword - the plain-text password
      encodedPassword - the encoded hash (without {id} prefix)
      Returns:
      true if matched