Package org.apache.sshd.common.digest
Class BaseDigest
java.lang.Object
org.apache.sshd.common.digest.BaseDigest
- All Implemented Interfaces:
Comparable<Digest>,AlgorithmNameProvider,Digest,DigestInformation
Base class for Digest algorithms based on the JCE provider.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseDigest(String algorithm, int bsize) Create a new digest using the given algorithm and block size. -
Method Summary
-
Field Details
-
algorithm
-
bsize
private final int bsize -
h
private int h -
s
-
md
-
-
Constructor Details
-
BaseDigest
Create a new digest using the given algorithm and block size. The initialization and creation of the underlyingMessageDigestobject will be done in theinit()method.- Parameters:
algorithm- the JCE algorithm to use for this digestbsize- the block size of this digest
-
-
Method Details
-
getAlgorithm
- Specified by:
getAlgorithmin interfaceAlgorithmNameProvider
-
getBlockSize
public int getBlockSize()- Specified by:
getBlockSizein interfaceDigestInformation- Returns:
- The number of bytes in the digest's output
-
init
-
update
-
update
-
getMessageDigest
- Returns:
- The current
MessageDigest- may benullifinit()not called
-
digest
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<Digest>
-
equals
-
toString
-