CmdID / aws / aws payment-cryptography-data
aws payment-cryptography-data generate-mac
Generates a Message Authentication Code (MAC) cryptogram within Amazon Web Services Payment Cryptography. AWS CLI reference
1 example 4 options Its page in the AWS CLI reference
Examples
To generate a MAC
The following generate-mac example generates a Hash-Based Message Authentication Code (HMAC) for card data authentication using the algorithm HMAC_SHA256 and an HMAC encryption key. The key must have KeyUsage set to TR31_M7_HMAC_KEY and KeyModesOfUse to Generate.
aws payment-cryptography-data generate-mac --key-identifier arn:aws:payment-cryptography:us-west-2:123456789012:key/kwapwa6qaifllw2h --message-data "3b313038383439303031303733393431353d32343038323236303030373030303f33" --generation-attributes Algorithm=HMAC_SHA256Identify--key-identifierThe keyARN of the MAC generation encryption key.--message-dataThe data for which a MAC is under generation.--generation-attributesThe attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.Its output
{
"KeyArn": "arn:aws:payment-cryptography:us-west-2:123456789012:key/kwapwa6qaifllw2h",
"KeyCheckValue": "2976E7",
"Mac": "ED87F26E961C6D0DDB78DA5038AA2BDDEA0DCE03E5B5E96BDDD494F4A7AA470C"
}For more information, see Generate MAC in the AWS Payment Cryptography User Guide.
Options
--generation-attributesThe attributes and data values to use for MAC generation within Amazon Web Services Payment Cryptography.--key-identifierThe keyARN of the MAC generation encryption key.--mac-lengthThe length of a MAC under generation.--message-dataThe data for which a MAC is under generation.