Stellent
HowToComponents
JavaDoc

intradoc.conversion
Class MessageDigest

java.lang.Object
  |
  +--intradoc.conversion.MessageDigest
Direct Known Subclasses:
Sha1

public abstract class MessageDigest
extends java.lang.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. Note: this code is based on the code supplied gotten from Chuck McManis creatd on 5 Oct 1996, Version 1.8 from the URL http://professionals.com/~cmcmanis//java/


Field Summary
 byte[] m_digestBits
           
 boolean m_digestValid
           
 
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  java.lang.String getAlg()
          Return a string that represents the algorithim of this message digest.
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.
 java.lang.String toString()
          Return a string representation of this object.
abstract  void update(byte aValue)
          The basic unit of digestifying is the byte.
 void update(byte[] input)
          Add an array of bytes to the digest.
 void update(byte[] input, int offset, int len)
          Add specific bytes to the digest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_digestBits

public byte[] m_digestBits

m_digestValid

public boolean m_digestValid
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(byte[] input,
                   int offset,
                   int len)
Add specific bytes to the digest.


update

public void update(byte[] input)
Add an array of bytes to the digest.


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.


toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.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.


getAlg

public abstract java.lang.String getAlg()
Return a string that represents the algorithim of this message digest.



(c) 1996-2005  All rights reserved.  Stellent, Inc.