GlideCertificateEncryption - generateMac(String key, String algorithm, String data)

Generates the Message Authentication Code (MAC), which is used to authenticate a message.

Table 1. Parameters
Name Type Description
key String Key used to sign the message.
algorithm String Algorithm used to generate the MAC: HmacSHA256, HmacSHA1, HmacMD5, and so on.
data String The data to be processed.
Table 2. Returns
Type Description
String MAC in base64 format.

Scoped equivalent

To use the generateMac() method in a scoped application, use the corresponding scoped method: CertificateEncryption - generateMac(String key, String algorithm, String data).

var mac = new GlideCertificateEncryption;
mac.generateMac("sample_key", "HmacSHA256", "sample_data");