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 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.
-
-
-
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 interfaceOutputDigestCalculator<T>
- Returns:
- a digest.
-
getParameters
public abstract T getParameters()
Description copied from interface:OutputDigestCalculator
Return the parameters for this digest calculator.- Specified by:
getParameters
in interfaceOutputDigestCalculator<T>
- Returns:
- the digest calculator's parameters.
-
getDigestSize
public abstract int getDigestSize()
Description copied from interface:OutputDigestCalculator
Return the size of the digest produced by this calculator in bytes.- Specified by:
getDigestSize
in interfaceOutputDigestCalculator<T>
- Returns:
- digest length in bytes.
-
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 interfaceOutputDigestCalculator<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 interfaceOutputDigestCalculator<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 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:OutputDigestCalculator
Reset the calculator back to its initial state.- Specified by:
reset
in interfaceOutputDigestCalculator<T>
-
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 interfaceOutputDigestCalculator<T>
- Overrides:
clone
in classjava.lang.Object
- Returns:
- a clone of the digest calculator.
- Throws:
java.lang.CloneNotSupportedException
- if cloning is not possible.
-
-