Class 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 Detail

      • ALGORITHM_SHA_1

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

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

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

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

        public static final String ALGORITHM_SHA_512
        HMAC using SHA512 as a hash function.
        Value is: "HmacSHA512".
        See Also:
        Constant Field Values
      • 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:
        Constant Field Values
      • 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:
        Constant Field Values
    • Method Detail

      • 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