Open SiteSearch 4.1.1
Final

ORG.oclc.ecat.util
Class MessageDigest

java.lang.Object
  |
  +--ORG.oclc.ecat.util.MessageDigest
Direct Known Subclasses:
MD5

public abstract class MessageDigest
extends Object

The MessageDigest class defines a general class for computing digest functions. It is defined as an abstract class that is subclassed by message digest algorithms. In this way the PKCS classes can be built to take a MessageDigest object without needing to know what 'kind' of message digest they are computing. This class defines the standard functions that all message digest algorithms share, and ways to put all Java fundamental types into the digest. It does not define methods for digestifying either arbitrary objects or arrays of objects however.


Field Summary
 byte[] digestBits
          the actual digest bits.
 boolean digestValid
          status of the digest
 
Constructor Summary
MessageDigest()
           
 
Method Summary
 void computeDigest(byte[] source)
          Complete digest computation on an array of bytes.
abstract  void finish()
          Perform the final computations and cleanup.
abstract  void init()
          This function is used to initialize any internal digest variables or parameters.
 boolean isEqual(byte[] otherDigest)
          Non static version that compares this digest to one passed.
static boolean isEqual(byte[] digesta, byte[] digestb)
          Compare two digests for equality.
 String stringVal()
          ` * Return a string representation of this object.
 String toString()
          ` * Return a string representation of this object.
 void update(boolean aValue)
           
abstract  void update(byte aValue)
          The basic unit of digestifying is the byte.
 void update(byte[] input)
           
 void update(int aValue)
           
 void update(int[] input)
           
 void update(long aValue)
           
 void update(long[] input)
           
 void update(short aValue)
           
 void update(short[] input)
           
 void update(String input)
          Add the bytes in the String 'input' to the current digest.
 void updateASCII(String input)
          Treat the string as a sequence of ISO-Latin1 (8 bit) characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

digestBits

public byte[] digestBits
the actual digest bits.

digestValid

public boolean digestValid
status of the digest
Constructor Detail

MessageDigest

public MessageDigest()
Method Detail

init

public abstract void init()
This function is used to initialize any internal digest variables or parameters.

update

public abstract void update(byte aValue)
The basic unit of digestifying is the byte. This method is defined by the particular algorithim's subclass for that algorithim. Subsequent versions of this method defined here decompose the basic type into bytes and call this function. If special processing is needed for a particular type your subclass should override the method for that type.

update

public void update(boolean aValue)

update

public void update(short aValue)

update

public void update(int aValue)

update

public void update(long aValue)

update

public void update(byte[] input)

update

public void update(short[] input)

update

public void update(int[] input)

update

public void update(long[] input)

update

public void update(String input)
Add the bytes in the String 'input' to the current digest. Note that the string characters are treated as unicode chars of 16 bits each. To digestify ISO-Latin1 strings (ASCII) use the updateASCII() method.

updateASCII

public void updateASCII(String input)
Treat the string as a sequence of ISO-Latin1 (8 bit) characters.

finish

public abstract void finish()
Perform the final computations and cleanup.

computeDigest

public void computeDigest(byte[] source)
Complete digest computation on an array of bytes.

stringVal

public String stringVal()
` * Return a string representation of this object.

toString

public String toString()
` * Return a string representation of this object.
Overrides:
toString in class Object

isEqual

public static boolean isEqual(byte[] digesta,
                              byte[] digestb)
Compare two digests for equality. Simple byte compare.

isEqual

public boolean isEqual(byte[] otherDigest)
Non static version that compares this digest to one passed.

Open SiteSearch 4.1.1
Final