O'Reilly logo

Java Security by Scott Oaks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Class java.security.MessageDigest

Synopsis

The message digest class is an engine class that can produce a one-way hash value for any arbitrary input. Message digests have two properties: they produce a unique hash for each set of input data (subject to the number of bits that are output), and the original input data is indiscernible from the hash output. The hash value is variously called a digital fingerprint or a digest. Message digests are components of digital signatures, but they are useful in their own right to verify that a set of data has not been corrupted. Once a digest object is created, data may be fed to it via the update() methods; the hash itself is returned via the digest() method.

Class Definition

public abstract class java.security.MessageDigest
	extends java.security.MessageDigestSpi {

	// Constructors
	protected MessageDigest(String);

	// Class Methods
	public static MessageDigest getInstance(String);
	public static MessageDigest getInstance(String, String);
	public static boolean isEqual(byte[], byte[]);

	// Instance Methods
	public Object clone();
	public byte[] digest();
	public byte[] digest(byte[]);
	public int digest(byte[], int, int);
	public final String getAlgorithm();
	public final int getDigestLength();
	public final Provider getProvider();
	public void reset();
	public String toString();
	public void update(byte);
	public void update(byte[]);
	public void update(byte[], int, int);
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required