Uses of Class java.security.MessageDigest (Java Platform SE 8 )
Date: 2026-04-17

## Uses of Class
java.security.MessageDigest

- Packages that use MessageDigest
  Package | Description
  --- | ---
  java.security | Provides the classes and interfaces for the security framework.

- - ### Uses of MessageDigest in java.security

    Fields in java.security declared as MessageDigest
    Modifier and Type | Field and Description
    --- | ---
    `protected MessageDigest` | DigestOutputStream.`digest` The message digest associated with this stream.
    `protected MessageDigest` | DigestInputStream.`digest` The message digest associated with this stream.

    Methods in java.security that return MessageDigest
    Modifier and Type | Method and Description
    --- | ---
    `static MessageDigest` | MessageDigest.`getInstance(String algorithm)` Returns a MessageDigest object that implements the specified digest algorithm.
    `static MessageDigest` | MessageDigest.`getInstance(String algorithm, Provider provider)` Returns a MessageDigest object that implements the specified digest algorithm.
    `static MessageDigest` | MessageDigest.`getInstance(String algorithm, String provider)` Returns a MessageDigest object that implements the specified digest algorithm.
    `MessageDigest` | DigestOutputStream.`getMessageDigest()` Returns the message digest associated with this stream.
    `MessageDigest` | DigestInputStream.`getMessageDigest()` Returns the message digest associated with this stream.

    Methods in java.security with parameters of type MessageDigest
    Modifier and Type | Method and Description
    --- | ---
    `void` | DigestOutputStream.`setMessageDigest(MessageDigest digest)` Associates the specified message digest with this stream.
    `void` | DigestInputStream.`setMessageDigest(MessageDigest digest)` Associates the specified message digest with this stream.

    Constructors in java.security with parameters of type MessageDigest
    Constructor and Description
    `DigestInputStream(InputStream stream, MessageDigest digest)` Creates a digest input stream, using the specified input stream and message digest.
    `DigestOutputStream(OutputStream stream, MessageDigest digest)` Creates a digest output stream, using the specified output stream and message digest.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.