Package org.bouncycastle.crypto.fips
Class FipsOutputDigestCalculator<T>
- java.lang.Object
-
- org.bouncycastle.crypto.fips.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 intgetDigest(byte[] output, int offSet)Output the current digest value for what has been written to the calculator's output stream.abstract intgetDigestBlockSize()Return the size, in bytes, of the internal block used by the digest in this calculator.abstract intgetDigestSize()Return the size of the digest produced by this calculator in bytes.abstract UpdateOutputStreamgetDigestStream()Returns a stream that will accept data for the purpose of calculating a digest.abstract TgetParameters()Return the parameters for this digest calculator.abstract voidreset()Reset the calculator back to its initial state.
-
-
-
Method Detail
-
getDigest
public final byte[] getDigest()
Description copied from interface:OutputDigestCalculatorReturn the digest calculated on what has been written to the calculator's output stream.- Specified by:
getDigestin interfaceOutputDigestCalculator<T>- Returns:
- a digest.
-
getParameters
public abstract T getParameters()
Description copied from interface:OutputDigestCalculatorReturn the parameters for this digest calculator.- Specified by:
getParametersin interfaceOutputDigestCalculator<T>- Returns:
- the digest calculator's parameters.
-
getDigestSize
public abstract int getDigestSize()
Description copied from interface:OutputDigestCalculatorReturn the size of the digest produced by this calculator in bytes.- Specified by:
getDigestSizein interfaceOutputDigestCalculator<T>- Returns:
- digest length in bytes.
-
getDigestBlockSize
public abstract int getDigestBlockSize()
Description copied from interface:OutputDigestCalculatorReturn the size, in bytes, of the internal block used by the digest in this calculator.- Specified by:
getDigestBlockSizein interfaceOutputDigestCalculator<T>- Returns:
- internal block size in bytes.
-
getDigestStream
public abstract UpdateOutputStream getDigestStream()
Description copied from interface:OutputDigestCalculatorReturns 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:
getDigestStreamin interfaceOutputDigestCalculator<T>- Returns:
- an OutputStream
-
getDigest
public abstract int getDigest(byte[] output, int offSet)Description copied from interface:OutputDigestCalculatorOutput the current digest value for what has been written to the calculator's output stream.- Specified by:
getDigestin interfaceOutputDigestCalculator<T>- Parameters:
output- output array to write the digest to.offSet- offset to start writing the digest at..- Returns:
- the number of bytes written.
-
reset
public abstract void reset()
Description copied from interface:OutputDigestCalculatorReset the calculator back to its initial state.- Specified by:
resetin interfaceOutputDigestCalculator<T>
-
clone
public abstract FipsOutputDigestCalculator<T> clone() throws java.lang.CloneNotSupportedException
Description copied from interface:OutputDigestCalculatorReturn a clone of this calculator.- Specified by:
clonein interfaceOutputDigestCalculator<T>- Overrides:
clonein classjava.lang.Object- Returns:
- a clone of the digest calculator.
- Throws:
java.lang.CloneNotSupportedException- if cloning is not possible.
-
-