Interface PasswordHashProvider

All Known Implementing Classes:
Argon2HashProvider, NOOPHashProvider, PBKPD2HashProvider

public interface PasswordHashProvider
Provides a irreversible hash for a password/key.
  • Method Summary

    Modifier and Type
    Method
    Description
    hash(String password)
    Create password hash.
    boolean
    verify(String password, String hashedPassword)
    Verify an entered password with a hashed password that has been previously hashed by hash(String).
  • Method Details

    • hash

      String hash(String password) throws Exception
      Create password hash.
      Parameters:
      password - password
      Returns:
      hashed password
      Throws:
      Exception - if hashing fails
    • verify

      boolean verify(String password, String hashedPassword) throws Exception
      Verify an entered password with a hashed password that has been previously hashed by hash(String).
      Parameters:
      password - password
      hashedPassword - hashed password
      Returns:
      true, if password matches hashed password
      Throws:
      Exception - if verifying fails