Mac Generation and Validation
The generate and verify MAC commands support a variety of MACs including HMAC, CMAC, EMV MAC, etc. For AS2805, there is an additional variation defined in AS2805.4.1. Typically in AS2805, incoming messages are verified using this MAC and outgoing messages include a MAC as well.
cat verify-mac.json { "KeyIdentifier": "arn:aws:payment-cryptography:us-east-2:111122223333:key/qnobl5lghrzunce6", "Mac": "86304058", "MessageData": "73D8BA54D3852951DAEA41", "VerificationAttributes": { "Algorithm": "AS2805_4_1" } }
$aws payment-cryptography-data verify-mac --cli-input-json file://verify-mac.json --region ap-southeast-2
{ "KeyIdentifier": "arn:aws:payment-cryptography:us-east-2:111122223333:key/qnobl5lghrzunce6", "KeyCheckValue": "2976E7" }