com.maverick.ssh.components
Interface Digest

All Superinterfaces:
SshComponent
All Known Implementing Classes:
AbstractDigest, MD5Digest, SHA1Digest, SHA256Digest

public interface Digest
extends SshComponent

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.
 String getName()
          Get the digest name
 void putBigInteger(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(String str)
          Put a String into the digest.
 void reset()
          Reset the underlying digest.
 

Method Detail

putBigInteger

void putBigInteger(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

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

Parameters:
b -

putBytes

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

Parameters:
data -

putBytes

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

Parameters:
data -
offset -
len -

putInt

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

Parameters:
i -

putString

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

Parameters:
str -

reset

void reset()
Reset the underlying digest.


doFinal

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

Returns:
the hash

getName

String getName()
Get the digest name

Specified by:
getName in interface SshComponent


Copyright © 2013. All Rights Reserved.