org.appng.core.security

## Class SaltedDigestSha1

- java.lang.Object
- - org.appng.core.security.SaltedDigestSha1

- All Implemented Interfaces:
    SaltedDigest

      public class SaltedDigestSha1
      extends Object
      implements SaltedDigest

  Provides methods required to create a salted hash of a given secret using the SHA-1 algorithm.
  Author:
    Matthias Herlitzius

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SaltedDigestSha1()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getDigest(String secret, String salt)` Returns a salted hash of the submitted secret.
    `String` | `getSalt()` Generates a random salt.

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

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

- - ### Constructor Detail

    - #### SaltedDigestSha1

          public SaltedDigestSha1()

  - ### Method Detail

    - #### getDigest

          public String getDigest(String secret,
                                  String salt)

      Description copied from interface: `SaltedDigest`
      Returns a salted hash of the submitted secret.
      Specified by:
        `getDigest` in interface `SaltedDigest`
      Parameters:
        `secret` - The cleartext secret.
        `salt` - The salt which should have been generated by the `SaltedDigest.getSalt()` method of the respective implementation.
      Returns:
        The salted hash (digest).

    - #### getSalt

          public String getSalt()

      Description copied from interface: `SaltedDigest`
      Generates a random salt. Can be used together with the `SaltedDigest.getDigest(String, String)` method of the respective implementation.
      Specified by:
        `getSalt` in interface `SaltedDigest`
      Returns:
        the random salt

Copyright © 2011–2023 aiticon GmbH. All rights reserved.