Class FipsOutputDigestCalculator<T>

  • Type Parameters:
    T - the parameters type associated with the final implementation of this calculator.
    All Implemented Interfaces:
    java.lang.Cloneable, OutputDigestCalculator<T>

    public abstract class FipsOutputDigestCalculator<T>
    extends java.lang.Object
    implements OutputDigestCalculator<T>
    Base class for the approved mode OutputDigestCalculator implementations.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract FipsOutputDigestCalculator<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.
      abstract int getDigest​(byte[] output, int offSet)
      Output the current digest value for what has been written to the calculator's output stream.
      abstract int getDigestBlockSize()
      Return the size, in bytes, of the internal block used by the digest in this calculator.
      abstract int getDigestSize()
      Return the size of the digest produced by this calculator in bytes.
      abstract UpdateOutputStream getDigestStream()
      Returns a stream that will accept data for the purpose of calculating a digest.
      abstract T getParameters()
      Return the parameters for this digest calculator.
      abstract void reset()
      Reset the calculator back to its initial state.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDigest

        public final byte[] getDigest()
        Description copied from interface: OutputDigestCalculator
        Return the digest calculated on what has been written to the calculator's output stream.
        Specified by:
        getDigest in interface OutputDigestCalculator<T>
        Returns:
        a digest.
      • getDigestBlockSize

        public abstract int getDigestBlockSize()
        Description copied from interface: OutputDigestCalculator
        Return the size, in bytes, of the internal block used by the digest in this calculator.
        Specified by:
        getDigestBlockSize in interface OutputDigestCalculator<T>
        Returns:
        internal block size in bytes.
      • getDigestStream

        public abstract UpdateOutputStream getDigestStream()
        Description copied from interface: OutputDigestCalculator
        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.
        Specified by:
        getDigestStream in interface OutputDigestCalculator<T>
        Returns:
        an OutputStream
      • getDigest

        public abstract int getDigest​(byte[] output,
                                      int offSet)
        Description copied from interface: OutputDigestCalculator
        Output the current digest value for what has been written to the calculator's output stream.
        Specified by:
        getDigest in interface OutputDigestCalculator<T>
        Parameters:
        output - output array to write the digest to.
        offSet - offset to start writing the digest at..
        Returns:
        the number of bytes written.
      • clone

        public abstract FipsOutputDigestCalculator<T> clone()
                                                     throws java.lang.CloneNotSupportedException
        Description copied from interface: OutputDigestCalculator
        Return a clone of this calculator.
        Specified by:
        clone in interface OutputDigestCalculator<T>
        Overrides:
        clone in class java.lang.Object
        Returns:
        a clone of the digest calculator.
        Throws:
        java.lang.CloneNotSupportedException - if cloning is not possible.