Interface OutputDigestCalculator<T>

Type Parameters:
T - the parameters type for the digest calculator.
All Superinterfaces:
Cloneable
All Known Implementing Classes:
FipsOutputDigestCalculator

public interface OutputDigestCalculator<T> extends Cloneable
Base interface for a digest calculator.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return a clone of this calculator.
    byte[]
    Return the digest calculated on what has been written to the calculator's output stream.
    int
    getDigest(byte[] output, int off)
    Output the current digest value for what has been written to the calculator's output stream.
    int
    Return the size, in bytes, of the internal block used by the digest in this calculator.
    int
    Return the size of the digest produced by this calculator in bytes.
    Returns a stream that will accept data for the purpose of calculating a digest.
    Return the parameters for this digest calculator.
    void
    Reset the calculator back to its initial state.
  • Method Details

    • getParameters

      T getParameters()
      Return the parameters for this digest calculator.
      Returns:
      the digest calculator's parameters.
    • getDigestSize

      int getDigestSize()
      Return the size of the digest produced by this calculator in bytes.
      Returns:
      digest length in bytes.
    • getDigestBlockSize

      int getDigestBlockSize()
      Return the size, in bytes, of the internal block used by the digest in this calculator.
      Returns:
      internal block size in bytes.
    • getDigestStream

      UpdateOutputStream getDigestStream()
      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

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

      int getDigest(byte[] output, int off)
      Output the current digest value for what has been written to the calculator's output stream.
      Parameters:
      output - output array to write the digest to.
      off - offset to start writing the digest at..
      Returns:
      the number of bytes written.
    • reset

      void reset()
      Reset the calculator back to its initial state.
    • clone

      Return a clone of this calculator.
      Returns:
      a clone of the digest calculator.
      Throws:
      CloneNotSupportedException - if cloning is not possible.