Interface MessageAuthenticationCodeAlgorithm

  • All Known Implementing Classes:
    HMAC

    public interface MessageAuthenticationCodeAlgorithm
    Message authentication code algorithm interface
    Author:
    Ruslan Nazirov
    • Method Detail

      • generateMAC

        byte[] generateMAC​(byte[] key,
                           byte[] data)
                    throws java.lang.Exception
        MAC generation
        Parameters:
        key - MAC secret key
        data - Data, which needed to be secure with MAC
        Returns:
        mac Message authentication code
        Throws:
        java.lang.Exception - MAC generation error
      • verifyMAC

        boolean verifyMAC​(byte[] key,
                          byte[] mac,
                          byte[] data)
                   throws java.lang.Exception
        MAC verification
        Parameters:
        key - MAC secret key
        mac - Message authentication code
        data - Data to check
        Returns:
        result Check result
        Throws:
        java.lang.Exception - MAC check error