Bouncy Castle Cryptography Library 1.84

org.bouncycastle.operator
Interface DigestCalculator

All Known Implementing Classes:
TruncatingDigestCalculator

public interface DigestCalculator

General interface for an operator that is able to calculate a digest from a stream of output.


Field Summary
static org.bouncycastle.asn1.x509.AlgorithmIdentifier SHA_256
           
static org.bouncycastle.asn1.x509.AlgorithmIdentifier SHA_512
           
 
Method Summary
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
          Return the algorithm identifier representing the digest implemented by this calculator.
 byte[] getDigest()
          Return the digest calculated on what has been written to the calculator's output stream.
 java.io.OutputStream getOutputStream()
          Returns a stream that will accept data for the purpose of calculating a digest.
 

Field Detail

SHA_256

public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier SHA_256

SHA_512

public static final org.bouncycastle.asn1.x509.AlgorithmIdentifier SHA_512
Method Detail

getAlgorithmIdentifier

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
Return the algorithm identifier representing the digest implemented by this calculator.

Returns:
algorithm id and parameters.

getOutputStream

public java.io.OutputStream getOutputStream()
Returns a stream that will accept data for the purpose of calculating a digest. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.

Returns:
an OutputStream

getDigest

public byte[] getDigest()
Return the digest calculated on what has been written to the calculator's output stream.

Returns:
a digest.

Bouncy Castle Cryptography Library 1.84