AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Generates a Message Authentication Code (MAC) cryptogram within Amazon Web Services Payment Cryptography.

You can use this operation to authenticate card-related data by using known data values to generate MAC for data validation between the sending and receiving parties. This operation uses message data, a secret encryption key and MAC algorithm to generate a unique MAC value for transmission. The receiving party of the MAC must use the same message data, secret encryption key and MAC algorithm to reproduce another MAC value for comparision.

You can use this operation to generate a DUPKT, CMAC, HMAC or EMV MAC by setting generation attributes and algorithm to the associated values. The MAC generation encryption key must have valid values for KeyUsage such as TR31_M7_HMAC_KEY for HMAC generation, and they key must have KeyModesOfUse set to Generate and Verify.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginGenerateMac and EndGenerateMac.

Namespace: Amazon.PaymentCryptographyData
Assembly: AWSSDK.PaymentCryptographyData.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<GenerateMacResponse> GenerateMacAsync(
         GenerateMacRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.PaymentCryptographyData.Model.GenerateMacRequest

Container for the necessary parameters to execute the GenerateMac service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the GenerateMac service method, as returned by PaymentCryptographyData.

Exceptions

ExceptionCondition
AccessDeniedException You do not have sufficient access to perform this action.
InternalServerException The request processing has failed because of an unknown error, exception, or failure.
ResourceNotFoundException The request was denied due to an invalid resource error.
ThrottlingException The request was denied due to request throttling.
ValidationException The request was denied due to an invalid request error.

Version Information

.NET:
Supported in: 8.0 and newer, Core 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5 and newer

See Also