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

      • 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:
        Constant Field Values
      • ALGORITHM_SHA_224

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

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

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

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

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

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

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

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

        public static final String ALGORITHM_SHA3_512
        Digest SHA3-512 algorithm.
        Value is: "SHA3-512".
        See Also:
        Constant Field Values
    • Method Detail

      • 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