Package com.io7m.idstore.model

# 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 Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `check(String expectedHash, String receivedPassword, byte[] salt)`
  Check if the given plain text password matches the expected hash.
  `static IdPasswordAlgorithmRedacted`
  `create()`
  Create an algorithm with the given iteration count and key length.
  `IdPassword`
  `createHashed(String passwordText, byte[] salt)`
  Create a hashed password.
  `String`
  `identifier()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.io7m.idstore.model.IdPasswordAlgorithmType

  `createHashed`

- ## 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