Enum Class HashMethod

java.lang.Object
java.lang.Enum<HashMethod>
ch.colabproject.colab.api.model.user.HashMethod
All Implemented Interfaces:
Serializable, Comparable<HashMethod>, Constable

public enum HashMethod extends Enum<HashMethod>
Hash method supported by the coLAB platform
Author:
maxence
  • Enum Constant Details

    • PBKDF2WithHmacSHA512_65536_64

      public static final HashMethod PBKDF2WithHmacSHA512_65536_64
      PBKDF2 with HMAC SHA-512, 65536 iterations generates 64 bytes (ie. 512 bits as SHA-512 does)
  • Method Details

    • values

      public static HashMethod[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static HashMethod valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • hash

      public abstract byte[] hash(String value, byte[] salt)
      compute digest from value.If given, the value is prefixed with the salt.
      Parameters:
      value - the value to hash
      salt - optional salt
      Returns:
      digested salted value
    • hash

      public byte[] hash(String value, String hexSalt)
      Parameters:
      value - value to hash
      hexSalt - hexEncoded salt
      Returns:
      digested salted value
      See Also: