com.maverick.ssh.components
Interface Digest

All Known Implementing Classes:
AbstractDigest, MD5Digest, SHA1Digest

public interface Digest

A general interface for a digest with utility methods to add java types into the digest.

Author:
Lee David Painter

Method Summary
 byte[] doFinal()
          Do the final processing and return the hash.
 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.
 

Method Detail

putBigInteger

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

Parameters:
bi -

putByte

public void putByte(byte b)
Put a single byte into the digest.

Parameters:
b -

putBytes

public void putBytes(byte[] data)
Put a byte array into the digest.

Parameters:
data -

putBytes

public void putBytes(byte[] data,
                     int offset,
                     int len)
Put a byte array into the digest

Parameters:
data -
offset -
len -

putInt

public void putInt(int i)
Put an integer into the digest.

Parameters:
i -

putString

public void putString(java.lang.String str)
Put a String into the digest.

Parameters:
str -

reset

public void reset()
Reset the underlying digest.


doFinal

public byte[] doFinal()
Do the final processing and return the hash.

Returns:
the hash


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