Interface TlsMAC

All Known Subinterfaces:
TlsHMAC
All Known Implementing Classes:
JceTlsHMAC

public interface TlsMAC
Interface for MAC services.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Return calculated MAC for any input passed in.
    void
    calculateMAC(byte[] output, int outOff)
    Write the calculated MAC to an output buffer.
    int
    Return the length of the MAC generated by this service.
    void
    Reset the MAC underlying this service.
    void
    setKey(byte[] key, int keyOff, int keyLen)
    Set the key to be used by the MAC implementation supporting this service.
    void
    update(byte[] input, int inOff, int length)
    Update the MAC with the passed in input.
  • Method Details

    • setKey

      void setKey(byte[] key, int keyOff, int keyLen)
      Set the key to be used by the MAC implementation supporting this service.
      Parameters:
      key - array holding the MAC key.
      keyOff - offset into the array the key starts at.
      keyLen - length of the key in the array.
    • update

      void update(byte[] input, int inOff, int length)
      Update the MAC with the passed in input.
      Parameters:
      input - input array containing the data.
      inOff - offset into the input array the input starts at.
      length - the length of the input data.
    • calculateMAC

      byte[] calculateMAC()
      Return calculated MAC for any input passed in.
      Returns:
      the MAC value.
    • calculateMAC

      void calculateMAC(byte[] output, int outOff)
      Write the calculated MAC to an output buffer.
      Parameters:
      output - output array to write the MAC to.
      outOff - offset into the output array to write the MAC to.
    • getMacLength

      int getMacLength()
      Return the length of the MAC generated by this service.
      Returns:
      the MAC length.
    • reset

      void reset()
      Reset the MAC underlying this service.