Class HmacDigest

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

public class HmacDigest extends Object implements Digest
The HmacDigest is used for simplification of the HMAC signature creation and verification.
  • Field Details

    • ALGORITHM_MD5

      @Deprecated public static final String ALGORITHM_MD5
      Deprecated.
      HMAC-MD5 should not be used for signature purposes, for more information see RFC6151 - Section 2.3.
      HMAC using MD5 as a hash function.
      Value is: "HmacMD5".
      See Also:
    • ALGORITHM_SHA_1

      public static final String ALGORITHM_SHA_1
      HMAC using SHA1 as a hash function.
      Value is: "HmacSHA1".
      See Also:
    • ALGORITHM_SHA_224

      public static final String ALGORITHM_SHA_224
      HMAC using SHA224 as a hash function.
      Value is: "HmacSHA224".
      See Also:
    • ALGORITHM_SHA_256

      public static final String ALGORITHM_SHA_256
      HMAC using SHA256 as a hash function.
      Value is: "HmacSHA256".
      See Also:
    • ALGORITHM_SHA_384

      public static final String ALGORITHM_SHA_384
      HMAC using SHA384 as a hash function.
      Value is: "HmacSHA384".
      See Also:
    • ALGORITHM_SHA_512

      public static final String ALGORITHM_SHA_512
      HMAC using SHA512 as a hash function.
      Value is: "HmacSHA512".
      See Also:
    • ALGORITHM_SHA_512_224

      public static final String ALGORITHM_SHA_512_224
      HMAC using SHA512/224 as a hash function.
      Value is: "HmacSHA512/224".
      See Also:
    • ALGORITHM_SHA_512_256

      public static final String ALGORITHM_SHA_512_256
      HMAC using SHA512/256 as a hash function.
      Value is: "HmacSHA512/256".
      See Also:
  • Method Details

    • builder

      public static HmacDigest.Builder builder()
      Create new builder.
      Returns:
      new builder
    • create

      public static HmacDigest create(byte[] hmacSecret)
      Create new instance based on provided HMAC secret. Algorithm of the returned instance is ALGORITHM_SHA_256.
      Parameters:
      hmacSecret - hmac secret
      Returns:
      new instance
    • 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