Interface OutputDigestCalculator<T>

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

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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      OutputDigestCalculator<T> clone()
      Return a clone of this calculator.
      byte[] getDigest()
      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 getDigestBlockSize()
      Return the size, in bytes, of the internal block used by the digest in this calculator.
      int getDigestSize()
      Return the size of the digest produced by this calculator in bytes.
      UpdateOutputStream getDigestStream()
      Returns a stream that will accept data for the purpose of calculating a digest.
      T getParameters()
      Return the parameters for this digest calculator.
      void reset()
      Reset the calculator back to its initial state.
    • Method Detail

      • 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

        OutputDigestCalculator<T> clone()
                                 throws java.lang.CloneNotSupportedException
        Return a clone of this calculator.
        Returns:
        a clone of the digest calculator.
        Throws:
        java.lang.CloneNotSupportedException - if cloning is not possible.