Generate and Verify MAC
To generate and verify a MAC, perform the following steps:
Create a session object and get an instance of the key using username, password, and property file path.
Create a
NaeHmacKey
object using HMAC Algorithm.Pass the byte array as a input to generate the MAC in byte array.
To verify the MAC, pass the previously generated MAC and the input data.