All Superinterfaces:
GordianConsumer

public interface GordianMac extends GordianConsumer
GordianKnot interface for Message Authentication Codes.
  • Method Details

    • getMacSpec

      GordianMacSpec getMacSpec()
      Obtain MacSpec.
      Returns:
      the MacSpec
    • getKey

      Obtain the key.
      Returns:
      the key
    • getInitVector

      byte[] getInitVector()
      Obtain the keyType.
      Returns:
      the keyType
    • getMacSize

      int getMacSize()
      Obtain the MAC size.
      Returns:
      the MAC size
    • init

      void init(GordianMacParameters pParams) throws GordianException
      Initialise the MAC with the given parameters.
      Parameters:
      pParams - the parameters
      Throws:
      GordianException - on error
    • initKeyBytes

      void initKeyBytes(byte[] pKeyBytes) throws GordianException
      Init with bytes as key.
      Parameters:
      pKeyBytes - the bytes to use
      Throws:
      GordianException - on error
    • finish

      byte[] finish()
      Calculate the MAC.
      Returns:
      the MAC
    • finish

      int finish(byte[] pBuffer, int pOffset) throws GordianException
      Calculate the MAC, and return it in the buffer provided.
      Parameters:
      pBuffer - the buffer to return the digest in.
      pOffset - the offset in the buffer to store the digest.
      Returns:
      the number of bytes placed into buffer
      Throws:
      GordianException - on error
    • finish

      default byte[] finish(byte[] pBytes) throws GordianException
      Update the MAC, calculate and reset it.
      Parameters:
      pBytes - the bytes to update with.
      Returns:
      the MAC
      Throws:
      GordianException - on error