Skip to Content
Java Security
book

Java Security

by Scott Oaks
May 1998
Intermediate to advanced
469 pages
14h 57m
English
O'Reilly Media, Inc.
Content preview from Java Security

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);
}
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Security Handbook

Java Security Handbook

Jamie Jaworski, Paul J. Perrone, Venkata S.R. Krishna Chaganti

Publisher Resources

ISBN: 1565924037Supplemental ContentCatalog PageErrata