Class IdPasswordAlgorithmRedacted

java.lang.Object
com.io7m.idstore.model.IdPasswordAlgorithmRedacted
All Implemented Interfaces:
IdPasswordAlgorithmType

public final class IdPasswordAlgorithmRedacted extends Object implements IdPasswordAlgorithmType
A "redacted" hashing algorithm used to represent passwords that should not be returned to users/admins.
  • Method Details

    • create

      public static IdPasswordAlgorithmRedacted create()
      Create an algorithm with the given iteration count and key length.
      Returns:
      An algorithm
    • check

      public boolean check(String expectedHash, String receivedPassword, byte[] salt)
      Description copied from interface: IdPasswordAlgorithmType
      Check if the given plain text password matches the expected hash.
      Specified by:
      check in interface IdPasswordAlgorithmType
      Parameters:
      expectedHash - The expected hexadecimal uppercase hash
      receivedPassword - The received plain text password
      salt - The salt value
      Returns:
      true if the password matches
    • createHashed

      public IdPassword createHashed(String passwordText, byte[] salt)
      Description copied from interface: IdPasswordAlgorithmType
      Create a hashed password.
      Specified by:
      createHashed in interface IdPasswordAlgorithmType
      Parameters:
      passwordText - The plain text password
      salt - A random salt value
      Returns:
      A hashed password
    • identifier

      public String identifier()
      Specified by:
      identifier in interface IdPasswordAlgorithmType
      Returns:
      The password algorithm identifier