com.maverick.ssh.components.jce
Class AbstractDigest

java.lang.Object
  extended bycom.maverick.ssh.components.jce.AbstractDigest
All Implemented Interfaces:
Digest
Direct Known Subclasses:
MD5Digest, SHA1Digest

public class AbstractDigest
extends java.lang.Object
implements Digest

An abstract class that implements the Digest interface to provide support for JCE based digests.

Author:
Lee David Painter

Constructor Summary
AbstractDigest(java.lang.String jceAlgorithm)
           
 
Method Summary
 byte[] doFinal()
          Do the final processing and return the hash.
 java.lang.String getProvider()
           
 void putBigInteger(java.math.BigInteger bi)
          Update the digest with a BigInteger value.
 void putByte(byte b)
          Put a single byte into the digest.
 void putBytes(byte[] data)
          Put a byte array into the digest.
 void putBytes(byte[] data, int offset, int len)
          Put a byte array into the digest
 void putInt(int i)
          Put an integer into the digest.
 void putString(java.lang.String str)
          Put a String into the digest.
 void reset()
          Reset the underlying digest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDigest

public AbstractDigest(java.lang.String jceAlgorithm)
               throws java.security.NoSuchAlgorithmException
Method Detail

doFinal

public byte[] doFinal()
Description copied from interface: Digest
Do the final processing and return the hash.

Specified by:
doFinal in interface Digest
Returns:
the hash

putBigInteger

public void putBigInteger(java.math.BigInteger bi)
Description copied from interface: Digest
Update the digest with a BigInteger value. This puts both the integer length of the BigInteger data and the binary data.

Specified by:
putBigInteger in interface Digest
Parameters:
bi -

putByte

public void putByte(byte b)
Description copied from interface: Digest
Put a single byte into the digest.

Specified by:
putByte in interface Digest
Parameters:
b -

putBytes

public void putBytes(byte[] data)
Description copied from interface: Digest
Put a byte array into the digest.

Specified by:
putBytes in interface Digest
Parameters:
data -

putBytes

public void putBytes(byte[] data,
                     int offset,
                     int len)
Description copied from interface: Digest
Put a byte array into the digest

Specified by:
putBytes in interface Digest
Parameters:
data -
offset -
len -

putInt

public void putInt(int i)
Description copied from interface: Digest
Put an integer into the digest.

Specified by:
putInt in interface Digest
Parameters:
i -

putString

public void putString(java.lang.String str)
Description copied from interface: Digest
Put a String into the digest.

Specified by:
putString in interface Digest
Parameters:
str -

reset

public void reset()
Description copied from interface: Digest
Reset the underlying digest.

Specified by:
reset in interface Digest

getProvider

public java.lang.String getProvider()


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.