Package org.bouncycastle.crypto.fips
Class FipsOutputMACCalculator<T>
- java.lang.Object
-
- org.bouncycastle.crypto.fips.FipsOutputMACCalculator<T>
-
- Type Parameters:
T
- the parameters type associated with the final implementation of this calculator.
- All Implemented Interfaces:
OutputMACCalculator<T>
public abstract class FipsOutputMACCalculator<T> extends java.lang.Object implements OutputMACCalculator<T>
Base class for the approved mode OutputMACCalculator implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]
getMAC()
Return the MAC calculated on what has been written to the calculator's output stream.abstract int
getMAC(byte[] output, int off)
Output the current MAC value for what has been written to the calculator's output stream.abstract int
getMACSize()
Return the size of the MAC produced by this calculator in bytes.abstract UpdateOutputStream
getMACStream()
Returns a stream that will accept data for the purpose of calculating a MAC.abstract T
getParameters()
Return the parameters for this MAC calculator.abstract void
reset()
Reset the calculator back to its initial state.
-
-
-
Method Detail
-
getMAC
public byte[] getMAC()
Description copied from interface:OutputMACCalculator
Return the MAC calculated on what has been written to the calculator's output stream.- Specified by:
getMAC
in interfaceOutputMACCalculator<T>
- Returns:
- a MAC.
-
getParameters
public abstract T getParameters()
Description copied from interface:OutputMACCalculator
Return the parameters for this MAC calculator.- Specified by:
getParameters
in interfaceOutputMACCalculator<T>
- Returns:
- the MAC calculator's parameters.
-
getMACSize
public abstract int getMACSize()
Description copied from interface:OutputMACCalculator
Return the size of the MAC produced by this calculator in bytes.- Specified by:
getMACSize
in interfaceOutputMACCalculator<T>
- Returns:
- MAC length in bytes.
-
getMACStream
public abstract UpdateOutputStream getMACStream()
Description copied from interface:OutputMACCalculator
Returns a stream that will accept data for the purpose of calculating a MAC. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.- Specified by:
getMACStream
in interfaceOutputMACCalculator<T>
- Returns:
- an UpdateOutputStream
-
getMAC
public abstract int getMAC(byte[] output, int off)
Description copied from interface:OutputMACCalculator
Output the current MAC value for what has been written to the calculator's output stream.- Specified by:
getMAC
in interfaceOutputMACCalculator<T>
- Parameters:
output
- output array to write the MAC to.off
- offset to start writing the MAC at.- Returns:
- the number of bytes written
-
reset
public abstract void reset()
Description copied from interface:OutputMACCalculator
Reset the calculator back to its initial state.- Specified by:
reset
in interfaceOutputMACCalculator<T>
-
-