org.apache.java.security
Class MessageDigest

java.lang.Object
  |
  +--org.apache.java.security.MessageDigest
Direct Known Subclasses:
MD5

public abstract class MessageDigest
extends java.lang.Object

This interface abstracts a message digest algorithm.

Note: even if standard Java 1.1 APIs already provide a message digest implementation, this class is used on those Java runtime environments (like Kaffe) where the package java.security is highly improbable to be found.

Version:
$Revision: 1.4 $ $Date: 1999/04/26 00:33:57 $

Constructor Summary
MessageDigest()
          Creates the algorithm and reset its state.
 
Method Summary
 void append(byte[] block)
          Append another block to the message.
 void append(byte[] block, int length)
          Append another block of specified length to the message.
abstract  void append(byte[] block, int offset, int length)
          Append another block of specified length to the message starting at the given offset.
 byte[] digest(byte[] block)
          Appends a message block and return its message digest.
 byte[] digest(byte[] block, int length)
          Appends a message block with specified length and return its message digest.
abstract  byte[] digest(byte[] message, int offset, int length)
          Appends a message block with specified length starting from the given offset and return its message digest.
abstract  void reset()
          Resets the state of the class.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

MessageDigest

public MessageDigest()
Creates the algorithm and reset its state.
Method Detail

reset

public abstract void reset()
Resets the state of the class. Beware: calling this method erases all data previously inserted.

append

public void append(byte[] block)
Append another block to the message.

append

public void append(byte[] block,
                   int length)
Append another block of specified length to the message.

append

public abstract void append(byte[] block,
                            int offset,
                            int length)
Append another block of specified length to the message starting at the given offset.

digest

public byte[] digest(byte[] block)
Appends a message block and return its message digest.

digest

public byte[] digest(byte[] block,
                     int length)
Appends a message block with specified length and return its message digest.

digest

public abstract byte[] digest(byte[] message,
                              int offset,
                              int length)
Appends a message block with specified length starting from the given offset and return its message digest.