Class MessageDigestCalculatingInputStream.Builder

    • Field Detail

      • messageDigest

        private java.security.MessageDigest messageDigest
    • Constructor Detail

      • Builder

        public Builder()
        Constructs a new builder of MessageDigestCalculatingInputStream.

        The default for compatibility is the MD5 cryptographic algorithm which is weak and should not be used.

    • Method Detail

      • setMessageDigest

        public void setMessageDigest​(java.security.MessageDigest messageDigest)
        Sets the message digest.

        The MD5 cryptographic algorithm is weak and should not be used.

        Parameters:
        messageDigest - the message digest.
      • setMessageDigest

        public void setMessageDigest​(java.lang.String algorithm)
                              throws java.security.NoSuchAlgorithmException
        Sets the name of the name of the message digest algorithm.

        The MD5 cryptographic algorithm is weak and should not be used.

        Parameters:
        algorithm - the name of the algorithm. See the MessageDigest section in the Java Cryptography Architecture Standard Algorithm Name Documentation for information about standard algorithm names.
        Throws:
        java.security.NoSuchAlgorithmException - if no Provider supports a MessageDigestSpi implementation for the specified algorithm.