Class HashDigest

java.lang.Object
io.helidon.common.crypto.HashDigest
All Implemented Interfaces:
Digest

public class HashDigest extends Object implements Digest
The HashDigest is used for ordinary data digest creation and verification.
Should not be used for authentication purposes.
  • Field Details

    • ALGORITHM_MD2

      @Deprecated public static final String ALGORITHM_MD2
      Deprecated.
      It is strongly recommended not to use this algorithm as stated here RFC6149 - Section 6.
      Digest MD2 algorithm.
      Value is: "MD2".
      See Also:
    • ALGORITHM_MD5

      @Deprecated public static final String ALGORITHM_MD5
      Deprecated.
      It is strongly recommended not to use this algorithm as stated here RFC6151 - Section 2.1.
      Digest MD5 algorithm.
      Value is: "MD5".
      See Also:
    • ALGORITHM_SHA_1

      @Deprecated public static final String ALGORITHM_SHA_1
      Deprecated.
      SHA-1 is unsafe to use alone due to its vulnerability to collision attacks
      Digest SHA-1 algorithm.
      Value is: "SHA-1".
      See Also:
    • ALGORITHM_SHA_224

      public static final String ALGORITHM_SHA_224
      Digest SHA-224 algorithm.
      Value is: "SHA-224".
      See Also:
    • ALGORITHM_SHA_256

      public static final String ALGORITHM_SHA_256
      Digest SHA-256 algorithm.
      Value is: "SHA-256".
      See Also:
    • ALGORITHM_SHA_384

      public static final String ALGORITHM_SHA_384
      Digest SHA-384 algorithm.
      Value is: "SHA-384".
      See Also:
    • ALGORITHM_SHA_512_224

      public static final String ALGORITHM_SHA_512_224
      Digest SHA-512/224 algorithm.
      Value is: "SHA-512/224".
      See Also:
    • ALGORITHM_SHA_512_256

      public static final String ALGORITHM_SHA_512_256
      Digest SHA-512/256 algorithm.
      Value is: "SHA-512/256".
      See Also:
    • ALGORITHM_SHA3_224

      public static final String ALGORITHM_SHA3_224
      Digest SHA3-224 algorithm.
      Value is: "SHA3-224".
      See Also:
    • ALGORITHM_SHA3_256

      public static final String ALGORITHM_SHA3_256
      Digest SHA3-256 algorithm.
      Value is: "SHA3-256".
      See Also:
    • ALGORITHM_SHA3_384

      public static final String ALGORITHM_SHA3_384
      Digest SHA3-384 algorithm.
      Value is: "SHA3-384".
      See Also:
    • ALGORITHM_SHA3_512

      public static final String ALGORITHM_SHA3_512
      Digest SHA3-512 algorithm.
      Value is: "SHA3-512".
      See Also:
  • Method Details

    • create

      public static HashDigest create(String algorithm)
      Create a new instance of this class based on selected algorithm.
      Parameters:
      algorithm - algorithm to be used
      Returns:
      new instance
    • builder

      public static HashDigest.Builder builder()
      Create new builder.
      Returns:
      new builder
    • digest

      public Base64Value digest(Base64Value value)
      Description copied from interface: Digest
      Create digest of the value.
      Specified by:
      digest in interface Digest
      Parameters:
      value - value to make digest from
      Returns:
      digest of the value