Interface SaltedHashService

All Known Implementing Classes:
JCASaltedHashService, NoSaltedHashService

public interface SaltedHashService
Interface for creating salted hashes from plaintext passwords and for validating passwords against stored salted hashes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Computes a salted hash of given plaintext password suitable for storing in a database.
    boolean
    validate(String password, String saltedHash)
    Checks whether given plaintext password corresponds to the given saltedHash.
  • Method Details

    • getSaltedHash

      String getSaltedHash(String password) throws SaltedHashException
      Computes a salted hash of given plaintext password suitable for storing in a database.
      Throws:
      SaltedHashException
    • validate

      boolean validate(String password, String saltedHash) throws SaltedHashException
      Checks whether given plaintext password corresponds to the given saltedHash.
      Parameters:
      password -
      saltedHash -
      Returns:
      true if the given password matches the given saltedHash; false otherwise.
      Throws:
      SaltedHashException - if the saltedHash cannot be parsed or if the hashing algorithm is not available.