Interface TlsMAC

  • All Known Subinterfaces:
    TlsHMAC
    All Known Implementing Classes:
    JceTlsHMAC

    public interface TlsMAC
    Interface for MAC services.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] calculateMAC()
      Return calculated MAC for any input passed in.
      void calculateMAC​(byte[] output, int outOff)
      Write the calculated MAC to an output buffer.
      int getMacLength()
      Return the length of the MAC generated by this service.
      void reset()
      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 Detail

      • 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.