io.vertx.ext.auth.mongo

## Interface HashStrategy

-     public interface HashStrategy

  Determines how the hashing is computed in the implementation You can implement this to provide a different hashing strategy to the default.
  Author:
    mremme

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `computeHash(String password, User user)` Compute the hashed password given the unhashed password and the user
    `String` | `getSalt(User user)` Retrieve the salt.
    `HashSaltStyle` | `getSaltStyle()` Get the defined `HashSaltStyle` of the current instance
    `String` | `getStoredPwd(User user)` Retrieve the password from the user, or as clear text or as hashed version, depending on the definition
    `void` | `setAlgorithm(HashAlgorithm algorithm)` Allows the selection of the hashing algorithm.
    `void` | `setExternalSalt(String salt)` Set an external salt.
    `void` | `setSaltStyle(HashSaltStyle saltStyle)` Set the saltstyle as defined by `HashSaltStyle`.

- - ### Method Detail

    - #### computeHash

          String computeHash(String password,
                             User user)

      Compute the hashed password given the unhashed password and the user
      Parameters:
        `password` - the unhashed password
        `user` - the user to get the salt for. This paramter is needed, if the `HashSaltStyle.COLUMN` is declared to be used
      Returns:
        the hashed password

    - #### getStoredPwd

          String getStoredPwd(User user)

      Retrieve the password from the user, or as clear text or as hashed version, depending on the definition
      Parameters:
        `user` - the user to get the stored password for
      Returns:
        the password, either as hashed version or as cleartext, depending on the preferences

    - #### getSalt

          String getSalt(User user)

      Retrieve the salt. The source of the salt can be the external salt or the propriate column of the given user, depending on the defined `HashSaltStyle`
      Parameters:
        `user` - the user to get the salt for. This paramter is needed, if the `HashSaltStyle.COLUMN` is declared to be used
      Returns:
        null in case of `HashSaltStyle.NO_SALT` the salt of the user or a defined external salt

    - #### setExternalSalt

          void setExternalSalt(String salt)

      Set an external salt. This method should be used in case of `HashSaltStyle.EXTERNAL`
      Parameters:
        `salt` - the salt, which shall be used

    - #### setSaltStyle

          void setSaltStyle(HashSaltStyle saltStyle)

      Set the saltstyle as defined by `HashSaltStyle`.
      Parameters:
        `saltStyle` - the `HashSaltStyle` to be used

    - #### getSaltStyle

          HashSaltStyle getSaltStyle()

      Get the defined `HashSaltStyle` of the current instance
      Returns:
        the saltStyle

    - #### setAlgorithm

          void setAlgorithm(HashAlgorithm algorithm)

      Allows the selection of the hashing algorithm.
      Parameters:
        `algorithm` - the choosen algorithm

Copyright © 2021 Eclipse. All rights reserved.