Package org.bouncycastle.crypto
Interface OutputMACCalculator<T>
- Type Parameters:
T- the parameters type for the MAC calculator.
- All Known Implementing Classes:
FipsOutputMACCalculator
public interface OutputMACCalculator<T>
Base interface for a MAC calculator.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]getMAC()Return the MAC calculated on what has been written to the calculator's output stream.intgetMAC(byte[] output, int off) Output the current MAC value for what has been written to the calculator's output stream.intReturn the size of the MAC produced by this calculator in bytes.Returns a stream that will accept data for the purpose of calculating a MAC.Return the parameters for this MAC calculator.voidreset()Reset the calculator back to its initial state.
-
Method Details
-
getParameters
T getParameters()Return the parameters for this MAC calculator.- Returns:
- the MAC calculator's parameters.
-
getMACSize
int getMACSize()Return the size of the MAC produced by this calculator in bytes.- Returns:
- MAC length in bytes.
-
getMACStream
UpdateOutputStream getMACStream()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.- Returns:
- an UpdateOutputStream
-
getMAC
byte[] getMAC()Return the MAC calculated on what has been written to the calculator's output stream.- Returns:
- a MAC.
-
getMAC
int getMAC(byte[] output, int off) Output the current MAC value for what has been written to the calculator's output stream.- Parameters:
output- output array to write the MAC to.off- offset to start writing the MAC at.- Returns:
- the number of bytes written
-
reset
void reset()Reset the calculator back to its initial state.
-