For the latest news and information visit
The GNU Crypto project

gnu.crypto.jce.hash
Class MessageDigestAdapter

java.lang.Object
  extended by java.security.MessageDigestSpi
      extended by gnu.crypto.jce.hash.MessageDigestAdapter
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
HavalSpi, MD2Spi, MD4Spi, MD5Spi, RipeMD128Spi, RipeMD160Spi, Sha160Spi, Sha256Spi, Sha384Spi, Sha512Spi, TigerSpi, WhirlpoolSpi

 class MessageDigestAdapter
extends MessageDigestSpi
implements Cloneable

The implementation of a generic MessageDigest adapter class to wrap gnu.crypto hash instances.

This class defines the Service Provider Interface (SPI) for the MessageDigest class, which provides the functionality of a message digest algorithm, such as MD5 or SHA. Message digests are secure one-way hash functions that take arbitrary-sized data and output a fixed- length hash value.

All the abstract methods in the MessageDigestSpi class are implemented by this class and all its sub-classes.

All the implementations which subclass this object, and which are serviced by the GNU Crypto provider implement the Cloneable interface.

Version:
$Revision: 1.2 $

Constructor Summary
protected MessageDigestAdapter(String mdName)
          Trivial protected constructor.
 
Method Summary
 Object clone()
           
 byte[] engineDigest()
           
 int engineDigest(byte[] buf, int offset, int len)
           
 int engineGetDigestLength()
           
 void engineReset()
           
 void engineUpdate(byte input)
           
 void engineUpdate(byte[] input, int offset, int len)
           
 
Methods inherited from class java.security.MessageDigestSpi
engineUpdate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDigestAdapter

protected MessageDigestAdapter(String mdName)
Trivial protected constructor.

Parameters:
mdName - the canonical name of the hash algorithm.
Method Detail

clone

public Object clone()
Overrides:
clone in class MessageDigestSpi

engineGetDigestLength

public int engineGetDigestLength()
Overrides:
engineGetDigestLength in class MessageDigestSpi

engineUpdate

public void engineUpdate(byte input)
Specified by:
engineUpdate in class MessageDigestSpi

engineUpdate

public void engineUpdate(byte[] input,
                         int offset,
                         int len)
Specified by:
engineUpdate in class MessageDigestSpi

engineDigest

public byte[] engineDigest()
Specified by:
engineDigest in class MessageDigestSpi

engineDigest

public int engineDigest(byte[] buf,
                        int offset,
                        int len)
                 throws DigestException
Overrides:
engineDigest in class MessageDigestSpi
Throws:
DigestException

engineReset

public void engineReset()
Specified by:
engineReset in class MessageDigestSpi

For the latest news and information visit
The GNU Crypto project

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.