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 Object implements OutputMACCalculator<T>
Base class for the approved mode OutputMACCalculator implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    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
    Return 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.
    abstract T
    Return the parameters for this MAC calculator.
    abstract void
    Reset the calculator back to its initial state.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • 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 interface OutputMACCalculator<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 interface OutputMACCalculator<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 interface OutputMACCalculator<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 interface OutputMACCalculator<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 interface OutputMACCalculator<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 interface OutputMACCalculator<T>