VOOZH about

URL: https://www.geeksforgeeks.org/java/digestoutputstream-getmessagedigest-method-in-java-with-examples/

⇱ DigestOutputStream getMessageDigest() method in Java with Examples - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

DigestOutputStream getMessageDigest() method in Java with Examples

Last Updated : 20 Jan, 2023

The getMessageDigest() method of java.security.DigestOutputStream class provides the MessageDigest assigned to this DigestOutputStream object. 

Syntax:

public MessageDigest getMessageDigest()

Return Value: This method returns MessageDigest object assigned to it. 

Note : All the programs in this article won’t run on online IDE as no ‘name’ file exists. You can check this code on Java compiler on your system. To check this code, create a file ‘name’ on your system. 

Below are the examples to illustrate the getMessageDigest() method: 

Example 1: 

Output:
Status : MD5 Message Digest from SUN, 

Example 2: 

Comment