Skip to content

GenerateMac

Source: src/AWS/PaymentCryptography/GenerateMac.ts

Runtime binding for payment-cryptography:GenerateMac — computes a Message Authentication Code over hex-encoded message data under a Key. Provide GenerateMacHttp on the Function to satisfy this service.

// init
const generateMac = yield* PaymentCryptography.GenerateMac(macKey);
// runtime — MessageData is hex-encoded
const result = yield* generateMac({
MessageData: "31323334353637383930313233343536",
GenerationAttributes: { Algorithm: "HMAC" },
});