

# Actions
<a name="API_Operations"></a>

The following actions are supported:
+  [DecryptData](API_DecryptData.md) 
+  [EncryptData](API_EncryptData.md) 
+  [GenerateAs2805KekValidation](API_GenerateAs2805KekValidation.md) 
+  [GenerateCardValidationData](API_GenerateCardValidationData.md) 
+  [GenerateMac](API_GenerateMac.md) 
+  [GenerateMacEmvPinChange](API_GenerateMacEmvPinChange.md) 
+  [GeneratePinData](API_GeneratePinData.md) 
+  [ReEncryptData](API_ReEncryptData.md) 
+  [TranslateKeyMaterial](API_TranslateKeyMaterial.md) 
+  [TranslatePinData](API_TranslatePinData.md) 
+  [VerifyAuthRequestCryptogram](API_VerifyAuthRequestCryptogram.md) 
+  [VerifyCardValidationData](API_VerifyCardValidationData.md) 
+  [VerifyMac](API_VerifyMac.md) 
+  [VerifyPinData](API_VerifyPinData.md) 

# DecryptData
<a name="API_DecryptData"></a>

Decrypts ciphertext data to plaintext using a symmetric (TDES, AES), asymmetric (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information, see [Decrypt data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/decrypt-data.html) in the * AWS Payment Cryptography User Guide*.

You can use an decryption key generated within AWS Payment Cryptography, or you can import your own decryption key by calling [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). For this operation, the key must have `KeyModesOfUse` set to `Decrypt`. In asymmetric decryption, AWS Payment Cryptography decrypts the ciphertext using the private component of the asymmetric encryption key pair. For data encryption outside of AWS Payment Cryptography, you can export the public component of the asymmetric key pair by calling [GetPublicCertificate](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html).

This operation also supports dynamic keys, allowing you to pass a dynamic decryption key as a TR-31 WrappedKeyBlock. This can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into AWS Payment Cryptography. To decrypt using dynamic keys, the `keyARN` is the Key Encryption Key (KEK) of the TR-31 wrapped decryption key material. The incoming wrapped key shall have a key purpose of D0 with a mode of use of B or D. For more information, see [Using Dynamic Keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/use-cases-acquirers-dynamickeys.html) in the * AWS Payment Cryptography User Guide*.

For symmetric and DUKPT decryption, AWS Payment Cryptography supports `TDES` and `AES` algorithms. For EMV decryption, AWS Payment Cryptography supports `TDES` algorithms. For asymmetric decryption, AWS Payment Cryptography supports `RSA`. 

When you use TDES or TDES DUKPT, the ciphertext data length must be a multiple of 8 bytes. For AES or AES DUKPT, the ciphertext data length must be a multiple of 16 bytes. For RSA, it sould be equal to the key size unless padding is enabled.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [EncryptData](API_EncryptData.md) 
+  [GetPublicCertificate](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) 
+  [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) 

## Request Syntax
<a name="API_DecryptData_RequestSyntax"></a>

```
POST /keys/KeyIdentifier/decrypt HTTP/1.1
Content-type: application/json

{
   "CipherText": "string",
   "DecryptionAttributes": { ... },
   "WrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   }
}
```

## URI Request Parameters
<a name="API_DecryptData_RequestParameters"></a>

The request uses the following URI parameters.

 ** [KeyIdentifier](#API_DecryptData_RequestSyntax) **   <a name="paymentcryptographydata-DecryptData-request-uri-KeyIdentifier"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for ciphertext decryption.  
When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

## Request Body
<a name="API_DecryptData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [CipherText](#API_DecryptData_RequestSyntax) **   <a name="paymentcryptographydata-DecryptData-request-CipherText"></a>
The ciphertext to decrypt.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4224.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [DecryptionAttributes](#API_DecryptData_RequestSyntax) **   <a name="paymentcryptographydata-DecryptData-request-DecryptionAttributes"></a>
The encryption key type and attributes for ciphertext decryption.  
Type: [EncryptionDecryptionAttributes](API_EncryptionDecryptionAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [WrappedKey](#API_DecryptData_RequestSyntax) **   <a name="paymentcryptographydata-DecryptData-request-WrappedKey"></a>
The WrappedKeyBlock containing the encryption key for ciphertext decryption.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

## Response Syntax
<a name="API_DecryptData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string",
   "PlainText": "string"
}
```

## Response Elements
<a name="API_DecryptData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_DecryptData_ResponseSyntax) **   <a name="paymentcryptographydata-DecryptData-response-KeyArn"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for ciphertext decryption.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_DecryptData_ResponseSyntax) **   <a name="paymentcryptographydata-DecryptData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [PlainText](#API_DecryptData_ResponseSyntax) **   <a name="paymentcryptographydata-DecryptData-response-PlainText"></a>
The decrypted plaintext data in hexBinary format.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4224.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+` 

## Errors
<a name="API_DecryptData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_DecryptData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/DecryptData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/DecryptData) 

# EncryptData
<a name="API_EncryptData"></a>

Encrypts plaintext data to ciphertext using a symmetric (TDES, AES), asymmetric (RSA), or derived (DUKPT or EMV) encryption key scheme. For more information, see [Encrypt data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html) in the * AWS Payment Cryptography User Guide*.

You can generate an encryption key within AWS Payment Cryptography by calling [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html). You can import your own encryption key by calling [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html).

For this operation, the key must have `KeyModesOfUse` set to `Encrypt`. In asymmetric encryption, plaintext is encrypted using public component. You can import the public component of an asymmetric key pair created outside AWS Payment Cryptography by calling [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). 

This operation also supports dynamic keys, allowing you to pass a dynamic encryption key as a TR-31 WrappedKeyBlock. This can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into AWS Payment Cryptography. To encrypt using dynamic keys, the `keyARN` is the Key Encryption Key (KEK) of the TR-31 wrapped encryption key material. The incoming wrapped key shall have a key purpose of D0 with a mode of use of B or D. For more information, see [Using Dynamic Keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/use-cases-acquirers-dynamickeys.html) in the * AWS Payment Cryptography User Guide*.

For symmetric and DUKPT encryption, AWS Payment Cryptography supports `TDES` and `AES` algorithms. For EMV encryption, AWS Payment Cryptography supports `TDES` algorithms.For asymmetric encryption, AWS Payment Cryptography supports `RSA`. 

When you use TDES or TDES DUKPT, the plaintext data length must be a multiple of 8 bytes. For AES or AES DUKPT, the plaintext data length must be a multiple of 16 bytes. For RSA, it sould be equal to the key size unless padding is enabled.

To encrypt using DUKPT, you must already have a BDK (Base Derivation Key) key in your account with `KeyModesOfUse` set to `DeriveKey`, or you can generate a new DUKPT key by calling [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html). To encrypt using EMV, you must already have an IMK (Issuer Master Key) key in your account with `KeyModesOfUse` set to `DeriveKey`.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*.

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [DecryptData](API_DecryptData.md) 
+  [GetPublicCertificate](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) 
+  [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) 
+  [ReEncryptData](API_ReEncryptData.md) 

## Request Syntax
<a name="API_EncryptData_RequestSyntax"></a>

```
POST /keys/KeyIdentifier/encrypt HTTP/1.1
Content-type: application/json

{
   "EncryptionAttributes": { ... },
   "PlainText": "string",
   "WrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   }
}
```

## URI Request Parameters
<a name="API_EncryptData_RequestParameters"></a>

The request uses the following URI parameters.

 ** [KeyIdentifier](#API_EncryptData_RequestSyntax) **   <a name="paymentcryptographydata-EncryptData-request-uri-KeyIdentifier"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for plaintext encryption.  
When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

## Request Body
<a name="API_EncryptData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [EncryptionAttributes](#API_EncryptData_RequestSyntax) **   <a name="paymentcryptographydata-EncryptData-request-EncryptionAttributes"></a>
The encryption key type and attributes for plaintext encryption.  
Type: [EncryptionDecryptionAttributes](API_EncryptionDecryptionAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [PlainText](#API_EncryptData_RequestSyntax) **   <a name="paymentcryptographydata-EncryptData-request-PlainText"></a>
The plaintext to be encrypted.  
For encryption using asymmetric keys, plaintext data length is constrained by encryption key strength that you define in `KeyAlgorithm` and padding type that you define in `AsymmetricEncryptionAttributes`. For more information, see [Encrypt data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/encrypt-data.html) in the * AWS Payment Cryptography User Guide*.
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4096.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [WrappedKey](#API_EncryptData_RequestSyntax) **   <a name="paymentcryptographydata-EncryptData-request-WrappedKey"></a>
The WrappedKeyBlock containing the encryption key for plaintext encryption.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

## Response Syntax
<a name="API_EncryptData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "CipherText": "string",
   "KeyArn": "string",
   "KeyCheckValue": "string"
}
```

## Response Elements
<a name="API_EncryptData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [CipherText](#API_EncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-EncryptData-response-CipherText"></a>
The encrypted ciphertext.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4224.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+` 

 ** [KeyArn](#API_EncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-EncryptData-response-KeyArn"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for plaintext encryption.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_EncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-EncryptData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_EncryptData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_EncryptData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/EncryptData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/EncryptData) 

# GenerateAs2805KekValidation
<a name="API_GenerateAs2805KekValidation"></a>

Generates a `KekValidationRequest` or a `KekValidationResponse` for node-to-node initialization between payment processing nodes using [Australian Standard 2805 (AS2805)](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.html).

During node-to-node initialization, both communicating nodes must validate that they possess the correct Key Encrypting Keys (KEKs) before proceeding with session key exchange. In AS2805, the sending KEK (KEKs) of one node corresponds to the receiving KEK (KEKr) of its partner node. Each node uses its KEK to encrypt and decrypt session keys exchanged between the nodes. A KEK can be created or imported into AWS Payment Cryptography using either the [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) or [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) operations.

To use `GenerateAs2805KekValidation` to generate a KEK validation request, set `KekValidationType` to `KekValidationRequest`. This operation returns both `RandomKeySend` (KRs) and `RandomKeyReceive` (KRr) as response values. The partnering node receives the KRs, uses its KEKr to decrypt it, and generates a KRr which is an inverted value of KRs. The node receiving the KRr validates it against its own KRr generated during KEK validation request outside of AWS Payment Cryptography.

You can also use this operation to generate a KEK validation response, by setting `KekValidationType` to `KekValidationResponse` and providing the incoming KRs. This operation then calculates a KRr. To learn more about more about node-to-node initialization, see [Validation of KEK](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.kekvalidation.html) in the * AWS Payment Cryptography User Guide*.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

## Request Syntax
<a name="API_GenerateAs2805KekValidation_RequestSyntax"></a>

```
POST /as2805kekvalidation/generate HTTP/1.1
Content-type: application/json

{
   "KekValidationType": { ... },
   "KeyIdentifier": "string",
   "RandomKeySendVariantMask": "string"
}
```

## URI Request Parameters
<a name="API_GenerateAs2805KekValidation_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GenerateAs2805KekValidation_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [KekValidationType](#API_GenerateAs2805KekValidation_RequestSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-request-KekValidationType"></a>
Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.  
Type: [As2805KekValidationType](API_As2805KekValidationType.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [KeyIdentifier](#API_GenerateAs2805KekValidation_RequestSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-request-KeyIdentifier"></a>
The `keyARN` of sending KEK that AWS Payment Cryptography uses for node-to-node initialization  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [RandomKeySendVariantMask](#API_GenerateAs2805KekValidation_RequestSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-request-RandomKeySendVariantMask"></a>
The key variant to use for generating a random key for KEK validation during node-to-node initialization.  
Type: String  
Valid Values: `VARIANT_MASK_82C0 | VARIANT_MASK_82`   
Required: Yes

## Response Syntax
<a name="API_GenerateAs2805KekValidation_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string",
   "RandomKeyReceive": "string",
   "RandomKeySend": "string"
}
```

## Response Elements
<a name="API_GenerateAs2805KekValidation_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_GenerateAs2805KekValidation_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-response-KeyArn"></a>
The `keyARN` of sending KEK that AWS Payment Cryptography validates for node-to-node initialization  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_GenerateAs2805KekValidation_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-response-KeyCheckValue"></a>
The key check value (KCV) of the sending KEK that AWS Payment Cryptography validates for node-to-node initialization.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [RandomKeyReceive](#API_GenerateAs2805KekValidation_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-response-RandomKeyReceive"></a>
The random key generated for receiving KEK validation. The initiating node sends this key to its partner node for validation.  
Type: String  
Length Constraints: Minimum length of 32. Maximum length of 48.  
Pattern: `(?:[0-9a-fA-F]{32}|[0-9a-fA-F]{48})` 

 ** [RandomKeySend](#API_GenerateAs2805KekValidation_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateAs2805KekValidation-response-RandomKeySend"></a>
The random key generated for sending KEK validation.  
Type: String  
Length Constraints: Minimum length of 32. Maximum length of 48.  
Pattern: `(?:[0-9a-fA-F]{32}|[0-9a-fA-F]{48})` 

## Errors
<a name="API_GenerateAs2805KekValidation_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_GenerateAs2805KekValidation_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/GenerateAs2805KekValidation) 

# GenerateCardValidationData
<a name="API_GenerateCardValidationData"></a>

Generates card-related validation data using algorithms such as Card Verification Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2), or Card Security Codes (CSC). For more information, see [Generate card data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-card-data.html) in the * AWS Payment Cryptography User Guide*.

This operation generates a CVV or CSC value that is printed on a payment credit or debit card during card production. The CVV or CSC, PAN (Primary Account Number) and expiration date of the card are required to check its validity during transaction processing. To begin this operation, a CVK (Card Verification Key) encryption key is required. You can use [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) or [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) to establish a CVK within AWS Payment Cryptography. The `KeyModesOfUse` should be set to `Generate` and `Verify` for a CVK encryption key. 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) 
+  [VerifyCardValidationData](API_VerifyCardValidationData.md) 

## Request Syntax
<a name="API_GenerateCardValidationData_RequestSyntax"></a>

```
POST /cardvalidationdata/generate HTTP/1.1
Content-type: application/json

{
   "GenerationAttributes": { ... },
   "KeyIdentifier": "string",
   "PrimaryAccountNumber": "string",
   "ValidationDataLength": number
}
```

## URI Request Parameters
<a name="API_GenerateCardValidationData_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GenerateCardValidationData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [GenerationAttributes](#API_GenerateCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-request-GenerationAttributes"></a>
The algorithm for generating CVV or CSC values for the card within AWS Payment Cryptography.  
Type: [CardGenerationAttributes](API_CardGenerationAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [KeyIdentifier](#API_GenerateCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-request-KeyIdentifier"></a>
The `keyARN` of the CVK encryption key that AWS Payment Cryptography uses to generate card data.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [PrimaryAccountNumber](#API_GenerateCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-request-PrimaryAccountNumber"></a>
The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.  
Type: String  
Length Constraints: Minimum length of 12. Maximum length of 19.  
Pattern: `[0-9]+`   
Required: Yes

 ** [ValidationDataLength](#API_GenerateCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-request-ValidationDataLength"></a>
The length of the CVV or CSC to be generated. The default value is 3.  
Type: Integer  
Valid Range: Minimum value of 3. Maximum value of 5.  
Required: No

## Response Syntax
<a name="API_GenerateCardValidationData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string",
   "ValidationData": "string"
}
```

## Response Elements
<a name="API_GenerateCardValidationData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_GenerateCardValidationData_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-response-KeyArn"></a>
The `keyARN` of the CVK encryption key that AWS Payment Cryptography uses to generate CVV or CSC.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_GenerateCardValidationData_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [ValidationData](#API_GenerateCardValidationData_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateCardValidationData-response-ValidationData"></a>
The CVV or CSC value that AWS Payment Cryptography generates for the card.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 5.  
Pattern: `[0-9]+` 

## Errors
<a name="API_GenerateCardValidationData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_GenerateCardValidationData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/GenerateCardValidationData) 

# GenerateMac
<a name="API_GenerateMac"></a>

Generates a Message Authentication Code (MAC) cryptogram within AWS 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 the key must have `KeyModesOfUse` set to `Generate`.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [VerifyMac](API_VerifyMac.md) 

## Request Syntax
<a name="API_GenerateMac_RequestSyntax"></a>

```
POST /mac/generate HTTP/1.1
Content-type: application/json

{
   "GenerationAttributes": { ... },
   "KeyIdentifier": "string",
   "MacLength": number,
   "MessageData": "string"
}
```

## URI Request Parameters
<a name="API_GenerateMac_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GenerateMac_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [GenerationAttributes](#API_GenerateMac_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMac-request-GenerationAttributes"></a>
The attributes and data values to use for MAC generation within AWS Payment Cryptography.  
Type: [MacAttributes](API_MacAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [KeyIdentifier](#API_GenerateMac_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMac-request-KeyIdentifier"></a>
The `keyARN` of the MAC generation encryption key.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [MacLength](#API_GenerateMac_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMac-request-MacLength"></a>
The length of a MAC under generation.  
Type: Integer  
Valid Range: Minimum value of 4. Maximum value of 16.  
Required: No

 ** [MessageData](#API_GenerateMac_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMac-request-MessageData"></a>
The data for which a MAC is under generation. This value must be hexBinary.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 8192.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

## Response Syntax
<a name="API_GenerateMac_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string",
   "Mac": "string"
}
```

## Response Elements
<a name="API_GenerateMac_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_GenerateMac_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMac-response-KeyArn"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for MAC generation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_GenerateMac_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMac-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [Mac](#API_GenerateMac_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMac-response-Mac"></a>
The MAC cryptogram generated within AWS Payment Cryptography.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 128.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_GenerateMac_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_GenerateMac_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/GenerateMac) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/GenerateMac) 

# GenerateMacEmvPinChange
<a name="API_GenerateMacEmvPinChange"></a>

Generates an issuer script mac for EMV payment cards that use offline PINs as the cardholder verification method (CVM).

This operation generates an authenticated issuer script response by appending the incoming message data (APDU command) with the target encrypted PIN block in ISO2 format. The command structure and method to send the issuer script update to the card is not defined by this operation and is typically determined by the applicable payment card scheme.

The primary inputs to this operation include the incoming new encrypted pinblock, PIN encryption key (PEK), issuer master key (IMK), primary account number (PAN), and the payment card derivation method.

The operation uses two issuer master keys - secure messaging for confidentiality (IMK-SMC) and secure messaging for integrity (IMK-SMI). The SMC key is used to internally derive a key to secure the pin, while SMI key is used to internally derive a key to authenticate the script reponse as per the [EMV 4.4 - Book 2 - Security and Key Management](https://www.emvco.com/specifications/) specification. 

This operation supports Amex, EMV2000, EMVCommon, Mastercard and Visa derivation methods, each requiring specific input parameters. Users must follow the specific derivation method and input parameters defined by the respective payment card scheme.

**Note**  
Use [GenerateMac](API_GenerateMac.md) operation when sending a script update to an EMV card that does not involve PIN change. When assigning IAM permissions, it is important to understand that [EncryptData](API_EncryptData.md) using EMV keys and [GenerateMac](API_GenerateMac.md) perform similar functions to this command.

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [EncryptData](API_EncryptData.md) 
+  [GenerateMac](API_GenerateMac.md) 

## Request Syntax
<a name="API_GenerateMacEmvPinChange_RequestSyntax"></a>

```
POST /macemvpinchange/generate HTTP/1.1
Content-type: application/json

{
   "DerivationMethodAttributes": { ... },
   "MessageData": "string",
   "NewEncryptedPinBlock": "string",
   "NewPinPekIdentifier": "string",
   "PinBlockFormat": "string",
   "SecureMessagingConfidentialityKeyIdentifier": "string",
   "SecureMessagingIntegrityKeyIdentifier": "string"
}
```

## URI Request Parameters
<a name="API_GenerateMacEmvPinChange_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GenerateMacEmvPinChange_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [DerivationMethodAttributes](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-DerivationMethodAttributes"></a>
The attributes and data values to derive payment card specific confidentiality and integrity keys.  
Type: [DerivationMethodAttributes](API_DerivationMethodAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [MessageData](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-MessageData"></a>
The message data is the APDU command from the card reader or terminal. The target encrypted PIN block, after translation to ISO2 format, is appended to this message data to generate an issuer script response.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 1024.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [NewEncryptedPinBlock](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-NewEncryptedPinBlock"></a>
The incoming new encrypted PIN block data for offline pin change on an EMV card.  
Type: String  
Length Constraints: Fixed length of 16.  
Pattern: `[0-9a-fA-F]+`   
Required: Yes

 ** [NewPinPekIdentifier](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-NewPinPekIdentifier"></a>
The `keyARN` of the PEK protecting the incoming new encrypted PIN block.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [PinBlockFormat](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-PinBlockFormat"></a>
The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.  
Type: String  
Valid Values: `ISO_FORMAT_0 | ISO_FORMAT_1 | ISO_FORMAT_3`   
Required: Yes

 ** [SecureMessagingConfidentialityKeyIdentifier](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-SecureMessagingConfidentialityKeyIdentifier"></a>
The `keyARN` of the issuer master key (IMK-SMC) used to protect the PIN block data in the issuer script response.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [SecureMessagingIntegrityKeyIdentifier](#API_GenerateMacEmvPinChange_RequestSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-request-SecureMessagingIntegrityKeyIdentifier"></a>
The `keyARN` of the issuer master key (IMK-SMI) used to authenticate the issuer script response.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

## Response Syntax
<a name="API_GenerateMacEmvPinChange_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "EncryptedPinBlock": "string",
   "Mac": "string",
   "NewPinPekArn": "string",
   "NewPinPekKeyCheckValue": "string",
   "SecureMessagingConfidentialityKeyArn": "string",
   "SecureMessagingConfidentialityKeyCheckValue": "string",
   "SecureMessagingIntegrityKeyArn": "string",
   "SecureMessagingIntegrityKeyCheckValue": "string",
   "VisaAmexDerivationOutputs": { 
      "AuthorizationRequestKeyArn": "string",
      "AuthorizationRequestKeyCheckValue": "string",
      "CurrentPinPekArn": "string",
      "CurrentPinPekKeyCheckValue": "string"
   }
}
```

## Response Elements
<a name="API_GenerateMacEmvPinChange_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [EncryptedPinBlock](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-EncryptedPinBlock"></a>
Returns the incoming new encrpted PIN block.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 32.  
Pattern: `[0-9a-fA-F]+` 

 ** [Mac](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-Mac"></a>
Returns the mac of the issuer script containing message data and appended target encrypted pin block in ISO2 format.  
Type: String  
Length Constraints: Minimum length of 8. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [NewPinPekArn](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-NewPinPekArn"></a>
Returns the `keyArn` of the PEK protecting the incoming new encrypted PIN block.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [NewPinPekKeyCheckValue](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-NewPinPekKeyCheckValue"></a>
The key check value (KCV) of the PEK uprotecting the incoming new encrypted PIN block.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [SecureMessagingConfidentialityKeyArn](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-SecureMessagingConfidentialityKeyArn"></a>
Returns the `keyArn` of the IMK-SMC used by the operation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [SecureMessagingConfidentialityKeyCheckValue](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-SecureMessagingConfidentialityKeyCheckValue"></a>
The key check value (KCV) of the SMC issuer master key used by the operation.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [SecureMessagingIntegrityKeyArn](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-SecureMessagingIntegrityKeyArn"></a>
Returns the `keyArn` of the IMK-SMI used by the operation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [SecureMessagingIntegrityKeyCheckValue](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-SecureMessagingIntegrityKeyCheckValue"></a>
The key check value (KCV) of the SMI issuer master key used by the operation.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [VisaAmexDerivationOutputs](#API_GenerateMacEmvPinChange_ResponseSyntax) **   <a name="paymentcryptographydata-GenerateMacEmvPinChange-response-VisaAmexDerivationOutputs"></a>
The attribute values used for Amex and Visa derivation methods.  
Type: [VisaAmexDerivationOutputs](API_VisaAmexDerivationOutputs.md) object

## Errors
<a name="API_GenerateMacEmvPinChange_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_GenerateMacEmvPinChange_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/GenerateMacEmvPinChange) 

# GeneratePinData
<a name="API_GeneratePinData"></a>

Generates pin-related data such as PIN, PIN Verification Value (PVV), PIN Block, and PIN Offset during new card issuance or reissuance. For more information, see [Generate PIN data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/generate-pin-data.html) in the * AWS Payment Cryptography User Guide*.

PIN data is never transmitted in clear to or from AWS Payment Cryptography. This operation generates PIN, PVV, or PIN Offset and then encrypts it using Pin Encryption Key (PEK) to create an `EncryptedPinBlock` for transmission from AWS Payment Cryptography. This operation uses a separate Pin Verification Key (PVK) for VISA PVV generation. 

Using ECDH key exchange, you can receive cardholder selectable PINs into AWS Payment Cryptography. The ECDH derived key protects the incoming PIN block. You can also use it for reveal PIN, wherein the generated PIN block is protected by the ECDH derived key before transmission from AWS Payment Cryptography. For more information on establishing ECDH derived keys, see the [Generating keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html) in the * AWS Payment Cryptography User Guide*.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*.

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [GenerateCardValidationData](API_GenerateCardValidationData.md) 
+  [TranslatePinData](API_TranslatePinData.md) 
+  [VerifyPinData](API_VerifyPinData.md) 

## Request Syntax
<a name="API_GeneratePinData_RequestSyntax"></a>

```
POST /pindata/generate HTTP/1.1
Content-type: application/json

{
   "EncryptionKeyIdentifier": "string",
   "EncryptionWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   },
   "GenerationAttributes": { ... },
   "GenerationKeyIdentifier": "string",
   "PinBlockFormat": "string",
   "PinDataLength": number,
   "PrimaryAccountNumber": "string"
}
```

## URI Request Parameters
<a name="API_GeneratePinData_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GeneratePinData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [EncryptionKeyIdentifier](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-EncryptionKeyIdentifier"></a>
The `keyARN` of the PEK that AWS Payment Cryptography uses to encrypt the PIN Block. For ECDH, it is the `keyARN` of the asymmetric ECC key.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [EncryptionWrappedKey](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-EncryptionWrappedKey"></a>
Parameter information of a WrappedKeyBlock for encryption key exchange.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

 ** [GenerationAttributes](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-GenerationAttributes"></a>
The attributes and values to use for PIN, PVV, or PIN Offset generation.  
Type: [PinGenerationAttributes](API_PinGenerationAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [GenerationKeyIdentifier](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-GenerationKeyIdentifier"></a>
The `keyARN` of the PEK that AWS Payment Cryptography uses for pin data generation.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [PinBlockFormat](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-PinBlockFormat"></a>
The PIN encoding format for pin data generation as specified in ISO 9564. AWS Payment Cryptography supports `ISO_Format_0`, `ISO_Format_3` and `ISO_Format_4`.  
The `ISO_Format_0` PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.  
The `ISO_Format_3` PIN block format is the same as `ISO_Format_0` except that the fill digits are random values from 10 to 15.  
The `ISO_Format_4` PIN block format is the only one supporting AES encryption.  
Type: String  
Valid Values: `ISO_FORMAT_0 | ISO_FORMAT_1 | ISO_FORMAT_3 | ISO_FORMAT_4`   
Required: Yes

 ** [PinDataLength](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-PinDataLength"></a>
The length of PIN under generation.  
Type: Integer  
Valid Range: Minimum value of 4. Maximum value of 12.  
Required: No

 ** [PrimaryAccountNumber](#API_GeneratePinData_RequestSyntax) **   <a name="paymentcryptographydata-GeneratePinData-request-PrimaryAccountNumber"></a>
The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.  
Type: String  
Length Constraints: Minimum length of 12. Maximum length of 19.  
Pattern: `[0-9]+`   
Required: No

## Response Syntax
<a name="API_GeneratePinData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "EncryptedPinBlock": "string",
   "EncryptionKeyArn": "string",
   "EncryptionKeyCheckValue": "string",
   "GenerationKeyArn": "string",
   "GenerationKeyCheckValue": "string",
   "PinData": { ... }
}
```

## Response Elements
<a name="API_GeneratePinData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [EncryptedPinBlock](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-EncryptedPinBlock"></a>
The PIN block encrypted under PEK from AWS Payment Cryptography. The encrypted PIN block is a composite of PAN (Primary Account Number) and PIN (Personal Identification Number), generated in accordance with ISO 9564 standard.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 32.  
Pattern: `[0-9a-fA-F]+` 

 ** [EncryptionKeyArn](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-EncryptionKeyArn"></a>
The `keyARN` of the PEK that AWS Payment Cryptography uses for encrypted pin block generation. For ECDH, it is the `keyARN` of the asymmetric ECC key.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [EncryptionKeyCheckValue](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-EncryptionKeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [GenerationKeyArn](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-GenerationKeyArn"></a>
The `keyARN` of the pin data generation key that AWS Payment Cryptography uses for PIN, PVV or PIN Offset generation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [GenerationKeyCheckValue](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-GenerationKeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [PinData](#API_GeneratePinData_ResponseSyntax) **   <a name="paymentcryptographydata-GeneratePinData-response-PinData"></a>
The attributes and values AWS Payment Cryptography uses for pin data generation.  
Type: [PinData](API_PinData.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.

## Errors
<a name="API_GeneratePinData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_GeneratePinData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/GeneratePinData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/GeneratePinData) 

# ReEncryptData
<a name="API_ReEncryptData"></a>

Re-encrypt ciphertext using DUKPT or Symmetric data encryption keys. 

You can either generate an encryption key within AWS Payment Cryptography by calling [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) or import your own encryption key by calling [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). The `KeyArn` for use with this operation must be in a compatible key state with `KeyModesOfUse` set to `Encrypt`. 

This operation also supports dynamic keys, allowing you to pass a dynamic encryption key as a TR-31 WrappedKeyBlock. This can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into AWS Payment Cryptography. To re-encrypt using dynamic keys, the `keyARN` is the Key Encryption Key (KEK) of the TR-31 wrapped encryption key material. The incoming wrapped key shall have a key purpose of D0 with a mode of use of B or D. For more information, see [Using Dynamic Keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/use-cases-acquirers-dynamickeys.html) in the * AWS Payment Cryptography User Guide*.

For symmetric and DUKPT encryption, AWS Payment Cryptography supports `TDES` and `AES` algorithms. To encrypt using DUKPT, a DUKPT key must already exist within your account with `KeyModesOfUse` set to `DeriveKey` or a new DUKPT can be generated by calling [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html).

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [DecryptData](API_DecryptData.md) 
+  [EncryptData](API_EncryptData.md) 
+  [GetPublicCertificate](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) 
+  [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) 

## Request Syntax
<a name="API_ReEncryptData_RequestSyntax"></a>

```
POST /keys/IncomingKeyIdentifier/reencrypt HTTP/1.1
Content-type: application/json

{
   "CipherText": "string",
   "IncomingEncryptionAttributes": { ... },
   "IncomingWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   },
   "OutgoingEncryptionAttributes": { ... },
   "OutgoingKeyIdentifier": "string",
   "OutgoingWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   }
}
```

## URI Request Parameters
<a name="API_ReEncryptData_RequestParameters"></a>

The request uses the following URI parameters.

 ** [IncomingKeyIdentifier](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-uri-IncomingKeyIdentifier"></a>
The `keyARN` of the encryption key of incoming ciphertext data.  
When a WrappedKeyBlock is provided, this value will be the identifier to the key wrapping key. Otherwise, it is the key identifier used to perform the operation.  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

## Request Body
<a name="API_ReEncryptData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [CipherText](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-CipherText"></a>
Ciphertext to be encrypted. The minimum allowed length is 16 bytes and maximum allowed length is 4096 bytes.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4224.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [IncomingEncryptionAttributes](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-IncomingEncryptionAttributes"></a>
The attributes and values for incoming ciphertext.  
Type: [ReEncryptionAttributes](API_ReEncryptionAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [IncomingWrappedKey](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-IncomingWrappedKey"></a>
The WrappedKeyBlock containing the encryption key of incoming ciphertext data.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

 ** [OutgoingEncryptionAttributes](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-OutgoingEncryptionAttributes"></a>
The attributes and values for outgoing ciphertext data after encryption by AWS Payment Cryptography.  
Type: [ReEncryptionAttributes](API_ReEncryptionAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [OutgoingKeyIdentifier](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-OutgoingKeyIdentifier"></a>
The `keyARN` of the encryption key of outgoing ciphertext data after encryption by AWS Payment Cryptography.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [OutgoingWrappedKey](#API_ReEncryptData_RequestSyntax) **   <a name="paymentcryptographydata-ReEncryptData-request-OutgoingWrappedKey"></a>
The WrappedKeyBlock containing the encryption key of outgoing ciphertext data after encryption by AWS Payment Cryptography.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

## Response Syntax
<a name="API_ReEncryptData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "CipherText": "string",
   "KeyArn": "string",
   "KeyCheckValue": "string"
}
```

## Response Elements
<a name="API_ReEncryptData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [CipherText](#API_ReEncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-ReEncryptData-response-CipherText"></a>
The encrypted ciphertext.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 4224.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+` 

 ** [KeyArn](#API_ReEncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-ReEncryptData-response-KeyArn"></a>
The keyARN (Amazon Resource Name) of the encryption key that AWS Payment Cryptography uses for plaintext encryption.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_ReEncryptData_ResponseSyntax) **   <a name="paymentcryptographydata-ReEncryptData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_ReEncryptData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_ReEncryptData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/ReEncryptData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/ReEncryptData) 

# TranslateKeyMaterial
<a name="API_TranslateKeyMaterial"></a>

Translates an cryptographic key between different wrapping keys without importing the key into AWS Payment Cryptography.

This operation can be used when key material is frequently rotated, such as during every card transaction, and there is a need to avoid importing short-lived keys into AWS Payment Cryptography. It translates short-lived transaction keys such as [PEK](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.pek) generated for each transaction and wrapped with an [ECDH](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.ecdh) derived wrapping key to another [KEK](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.kek) wrapping key. 

Before using this operation, you must first request the public key certificate of the ECC key pair generated within AWS Payment Cryptography to establish an ECDH key agreement. In `TranslateKeyData`, the service uses its own ECC key pair, public certificate of receiving ECC key pair, and the key derivation parameters to generate a derived key. The service uses this derived key to unwrap the incoming transaction key received as a TR31WrappedKeyBlock and re-wrap using a user provided KEK to generate an outgoing Tr31WrappedKeyBlock.

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) 
+  [GetPublicCertificate](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html) 
+  [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html) 

## Request Syntax
<a name="API_TranslateKeyMaterial_RequestSyntax"></a>

```
POST /keymaterial/translate HTTP/1.1
Content-type: application/json

{
   "IncomingKeyMaterial": { ... },
   "KeyCheckValueAlgorithm": "string",
   "OutgoingKeyMaterial": { ... }
}
```

## URI Request Parameters
<a name="API_TranslateKeyMaterial_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_TranslateKeyMaterial_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [IncomingKeyMaterial](#API_TranslateKeyMaterial_RequestSyntax) **   <a name="paymentcryptographydata-TranslateKeyMaterial-request-IncomingKeyMaterial"></a>
Parameter information of the TR31WrappedKeyBlock containing the transaction key.  
Type: [IncomingKeyMaterial](API_IncomingKeyMaterial.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [KeyCheckValueAlgorithm](#API_TranslateKeyMaterial_RequestSyntax) **   <a name="paymentcryptographydata-TranslateKeyMaterial-request-KeyCheckValueAlgorithm"></a>
The key check value (KCV) algorithm used for calculating the KCV of the derived key.  
Type: String  
Valid Values: `CMAC | ANSI_X9_24 | HMAC | SHA_1`   
Required: No

 ** [OutgoingKeyMaterial](#API_TranslateKeyMaterial_RequestSyntax) **   <a name="paymentcryptographydata-TranslateKeyMaterial-request-OutgoingKeyMaterial"></a>
Parameter information of the wrapping key used to wrap the transaction key in the outgoing TR31WrappedKeyBlock.  
Type: [OutgoingKeyMaterial](API_OutgoingKeyMaterial.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

## Response Syntax
<a name="API_TranslateKeyMaterial_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "WrappedKey": { 
      "KeyCheckValue": "string",
      "WrappedKeyMaterial": "string",
      "WrappedKeyMaterialFormat": "string"
   }
}
```

## Response Elements
<a name="API_TranslateKeyMaterial_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [WrappedKey](#API_TranslateKeyMaterial_ResponseSyntax) **   <a name="paymentcryptographydata-TranslateKeyMaterial-response-WrappedKey"></a>
The outgoing KEK wrapped TR31WrappedKeyBlock.  
Type: [WrappedWorkingKey](API_WrappedWorkingKey.md) object

## Errors
<a name="API_TranslateKeyMaterial_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_TranslateKeyMaterial_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/TranslateKeyMaterial) 

# TranslatePinData
<a name="API_TranslatePinData"></a>

Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For more information, see [Translate PIN data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/translate-pin-data.html) in the * AWS Payment Cryptography User Guide*.

PIN block translation involves changing a PIN block from one encryption key to another and optionally change its format. PIN block translation occurs entirely within the HSM boundary and PIN data never enters or leaves AWS Payment Cryptography in clear text. The encryption key transformation can be from PEK (Pin Encryption Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK.

 AWS Payment Cryptography also supports use of dynamic keys and ECDH (Elliptic Curve Diffie-Hellman) based key exchange for this operation.

Dynamic keys allow you to pass a PEK as a TR-31 WrappedKeyBlock. They can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into AWS Payment Cryptography. To translate PIN block using dynamic keys, the `keyARN` is the Key Encryption Key (KEK) of the TR-31 wrapped PEK. The incoming wrapped key shall have a key purpose of P0 with a mode of use of B or D. For more information, see [Using Dynamic Keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/use-cases-acquirers-dynamickeys.html) in the * AWS Payment Cryptography User Guide*.

Using ECDH key exchange, you can receive cardholder selectable PINs into AWS Payment Cryptography. The ECDH derived key protects the incoming PIN block, which is translated to a PEK encrypted PIN block for use within the service. You can also use ECDH for reveal PIN, wherein the service translates the PIN block from PEK to a ECDH derived encryption key. For more information on establishing ECDH derived keys, see the [Creating keys](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html) in the * AWS Payment Cryptography User Guide*.

The allowed combinations of PIN block format translations are guided by PCI. It is important to note that not all encrypted PIN block formats (example, format 1) require PAN (Primary Account Number) as input. And as such, PIN block format that requires PAN (example, formats 0,3,4) cannot be translated to a format (format 1) that does not require a PAN for generation. 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*.

**Note**  
 AWS Payment Cryptography currently supports ISO PIN block 4 translation for PIN block built using legacy PAN length. That is, PAN is the right most 12 digits excluding the check digits.

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [GeneratePinData](API_GeneratePinData.md) 
+  [VerifyPinData](API_VerifyPinData.md) 

## Request Syntax
<a name="API_TranslatePinData_RequestSyntax"></a>

```
POST /pindata/translate HTTP/1.1
Content-type: application/json

{
   "EncryptedPinBlock": "string",
   "IncomingAs2805Attributes": { 
      "SystemTraceAuditNumber": "string",
      "TransactionAmount": "string"
   },
   "IncomingDukptAttributes": { 
      "DukptKeyDerivationType": "string",
      "DukptKeyVariant": "string",
      "KeySerialNumber": "string"
   },
   "IncomingKeyIdentifier": "string",
   "IncomingTranslationAttributes": { ... },
   "IncomingWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   },
   "OutgoingDukptAttributes": { 
      "DukptKeyDerivationType": "string",
      "DukptKeyVariant": "string",
      "KeySerialNumber": "string"
   },
   "OutgoingKeyIdentifier": "string",
   "OutgoingTranslationAttributes": { ... },
   "OutgoingWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   }
}
```

## URI Request Parameters
<a name="API_TranslatePinData_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_TranslatePinData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [EncryptedPinBlock](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-EncryptedPinBlock"></a>
The encrypted PIN block data that AWS Payment Cryptography translates.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 32.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [IncomingAs2805Attributes](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-IncomingAs2805Attributes"></a>
The attributes and values to use for incoming AS2805 encryption key for PIN block translation.  
Type: [As2805PekDerivationAttributes](API_As2805PekDerivationAttributes.md) object  
Required: No

 ** [IncomingDukptAttributes](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-IncomingDukptAttributes"></a>
The attributes and values to use for incoming DUKPT encryption key for PIN block translation.  
Type: [DukptDerivationAttributes](API_DukptDerivationAttributes.md) object  
Required: No

 ** [IncomingKeyIdentifier](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-IncomingKeyIdentifier"></a>
The `keyARN` of the encryption key under which incoming PIN block data is encrypted. This key type can be PEK or BDK.  
For dynamic keys, it is the `keyARN` of KEK of the TR-31 wrapped PEK. For ECDH, it is the `keyARN` of the asymmetric ECC key.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [IncomingTranslationAttributes](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-IncomingTranslationAttributes"></a>
The format of the incoming PIN block data for translation within AWS Payment Cryptography.  
Type: [TranslationIsoFormats](API_TranslationIsoFormats.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [IncomingWrappedKey](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-IncomingWrappedKey"></a>
The WrappedKeyBlock containing the encryption key under which incoming PIN block data is encrypted.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

 ** [OutgoingDukptAttributes](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-OutgoingDukptAttributes"></a>
The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.  
Type: [DukptDerivationAttributes](API_DukptDerivationAttributes.md) object  
Required: No

 ** [OutgoingKeyIdentifier](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-OutgoingKeyIdentifier"></a>
The `keyARN` of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.  
For ECDH, it is the `keyARN` of the asymmetric ECC key.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [OutgoingTranslationAttributes](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-OutgoingTranslationAttributes"></a>
The format of the outgoing PIN block data after translation by AWS Payment Cryptography.  
Type: [TranslationIsoFormats](API_TranslationIsoFormats.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [OutgoingWrappedKey](#API_TranslatePinData_RequestSyntax) **   <a name="paymentcryptographydata-TranslatePinData-request-OutgoingWrappedKey"></a>
The WrappedKeyBlock containing the encryption key for encrypting outgoing PIN block data.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

## Response Syntax
<a name="API_TranslatePinData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string",
   "PinBlock": "string"
}
```

## Response Elements
<a name="API_TranslatePinData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_TranslatePinData_ResponseSyntax) **   <a name="paymentcryptographydata-TranslatePinData-response-KeyArn"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses to encrypt outgoing PIN block data after translation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_TranslatePinData_ResponseSyntax) **   <a name="paymentcryptographydata-TranslatePinData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [PinBlock](#API_TranslatePinData_ResponseSyntax) **   <a name="paymentcryptographydata-TranslatePinData-response-PinBlock"></a>
The outgoing encrypted PIN block data after translation.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 32.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_TranslatePinData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

## See Also
<a name="API_TranslatePinData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/TranslatePinData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/TranslatePinData) 

# VerifyAuthRequestCryptogram
<a name="API_VerifyAuthRequestCryptogram"></a>

Verifies Authorization Request Cryptogram (ARQC) for a EMV chip payment card authorization. For more information, see [Verify auth request cryptogram](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.verifyauthrequestcryptogram.html) in the * AWS Payment Cryptography User Guide*.

ARQC generation is done outside of AWS Payment Cryptography and is typically generated on a point of sale terminal for an EMV chip card to obtain payment authorization during transaction time. For ARQC verification, you must first import the ARQC generated outside of AWS Payment Cryptography by calling [ImportKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html). This operation uses the imported ARQC and an major encryption key (DUKPT) created by calling [CreateKey](https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html) to either provide a boolean ARQC verification result or provide an APRC (Authorization Response Cryptogram) response using Method 1 or Method 2. The `ARPC_METHOD_1` uses `AuthResponseCode` to generate ARPC and `ARPC_METHOD_2` uses `CardStatusUpdate` to generate ARPC. 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*.

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [VerifyCardValidationData](API_VerifyCardValidationData.md) 
+  [VerifyPinData](API_VerifyPinData.md) 

## Request Syntax
<a name="API_VerifyAuthRequestCryptogram_RequestSyntax"></a>

```
POST /cryptogram/verify HTTP/1.1
Content-type: application/json

{
   "AuthRequestCryptogram": "string",
   "AuthResponseAttributes": { ... },
   "KeyIdentifier": "string",
   "MajorKeyDerivationMode": "string",
   "SessionKeyDerivationAttributes": { ... },
   "TransactionData": "string"
}
```

## URI Request Parameters
<a name="API_VerifyAuthRequestCryptogram_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_VerifyAuthRequestCryptogram_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [AuthRequestCryptogram](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-AuthRequestCryptogram"></a>
The auth request cryptogram imported into AWS Payment Cryptography for ARQC verification using a major encryption key and transaction data.  
Type: String  
Length Constraints: Fixed length of 16.  
Pattern: `[0-9a-fA-F]+`   
Required: Yes

 ** [AuthResponseAttributes](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-AuthResponseAttributes"></a>
The attributes and values for auth request cryptogram verification. These parameters are required in case using ARPC Method 1 or Method 2 for ARQC verification.  
Type: [CryptogramAuthResponse](API_CryptogramAuthResponse.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: No

 ** [KeyIdentifier](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-KeyIdentifier"></a>
The `keyARN` of the major encryption key that AWS Payment Cryptography uses for ARQC verification.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [MajorKeyDerivationMode](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-MajorKeyDerivationMode"></a>
The method to use when deriving the major encryption key for ARQC verification within AWS Payment Cryptography. The same key derivation mode was used for ARQC generation outside of AWS Payment Cryptography.  
Type: String  
Valid Values: `EMV_OPTION_A | EMV_OPTION_B`   
Required: Yes

 ** [SessionKeyDerivationAttributes](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-SessionKeyDerivationAttributes"></a>
The attributes and values to use for deriving a session key for ARQC verification within AWS Payment Cryptography. The same attributes were used for ARQC generation outside of AWS Payment Cryptography.  
Type: [SessionKeyDerivation](API_SessionKeyDerivation.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [TransactionData](#API_VerifyAuthRequestCryptogram_RequestSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-request-TransactionData"></a>
The transaction data that AWS Payment Cryptography uses for ARQC verification. The same transaction is used for ARQC generation outside of AWS Payment Cryptography.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 1024.  
Pattern: `[0-9a-fA-F]+`   
Required: Yes

## Response Syntax
<a name="API_VerifyAuthRequestCryptogram_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "AuthResponseValue": "string",
   "KeyArn": "string",
   "KeyCheckValue": "string"
}
```

## Response Elements
<a name="API_VerifyAuthRequestCryptogram_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [AuthResponseValue](#API_VerifyAuthRequestCryptogram_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-response-AuthResponseValue"></a>
The result for ARQC verification or ARPC generation within AWS Payment Cryptography.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [KeyArn](#API_VerifyAuthRequestCryptogram_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-response-KeyArn"></a>
The `keyARN` of the major encryption key that AWS Payment Cryptography uses for ARQC verification.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_VerifyAuthRequestCryptogram_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyAuthRequestCryptogram-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_VerifyAuthRequestCryptogram_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

 ** VerificationFailedException **   
This request failed verification.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_VerifyAuthRequestCryptogram_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/VerifyAuthRequestCryptogram) 

# VerifyCardValidationData
<a name="API_VerifyCardValidationData"></a>

Verifies card-related validation data using algorithms such as Card Verification Values (CVV/CVV2), Dynamic Card Verification Values (dCVV/dCVV2) and Card Security Codes (CSC). For more information, see [Verify card data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-card-data.html) in the * AWS Payment Cryptography User Guide*.

This operation validates the CVV or CSC codes that is printed on a payment credit or debit card during card payment transaction. The input values are typically provided as part of an inbound transaction to an issuer or supporting platform partner. AWS Payment Cryptography uses CVV or CSC, PAN (Primary Account Number) and expiration date of the card to check its validity during transaction processing. In this operation, the CVK (Card Verification Key) encryption key for use with card data verification is same as the one in used for [GenerateCardValidationData](API_GenerateCardValidationData.md). 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [GenerateCardValidationData](API_GenerateCardValidationData.md) 
+  [VerifyAuthRequestCryptogram](API_VerifyAuthRequestCryptogram.md) 
+  [VerifyPinData](API_VerifyPinData.md) 

## Request Syntax
<a name="API_VerifyCardValidationData_RequestSyntax"></a>

```
POST /cardvalidationdata/verify HTTP/1.1
Content-type: application/json

{
   "KeyIdentifier": "string",
   "PrimaryAccountNumber": "string",
   "ValidationData": "string",
   "VerificationAttributes": { ... }
}
```

## URI Request Parameters
<a name="API_VerifyCardValidationData_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_VerifyCardValidationData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [KeyIdentifier](#API_VerifyCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-request-KeyIdentifier"></a>
The `keyARN` of the CVK encryption key that AWS Payment Cryptography uses to verify card data.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [PrimaryAccountNumber](#API_VerifyCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-request-PrimaryAccountNumber"></a>
The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.  
Type: String  
Length Constraints: Minimum length of 12. Maximum length of 19.  
Pattern: `[0-9]+`   
Required: Yes

 ** [ValidationData](#API_VerifyCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-request-ValidationData"></a>
The CVV or CSC value for use for card data verification within AWS Payment Cryptography.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 5.  
Pattern: `[0-9]+`   
Required: Yes

 ** [VerificationAttributes](#API_VerifyCardValidationData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-request-VerificationAttributes"></a>
The algorithm to use for verification of card data within AWS Payment Cryptography.  
Type: [CardVerificationAttributes](API_CardVerificationAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

## Response Syntax
<a name="API_VerifyCardValidationData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string"
}
```

## Response Elements
<a name="API_VerifyCardValidationData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_VerifyCardValidationData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-response-KeyArn"></a>
The `keyARN` of the CVK encryption key that AWS Payment Cryptography uses to verify CVV or CSC.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_VerifyCardValidationData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyCardValidationData-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_VerifyCardValidationData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

 ** VerificationFailedException **   
This request failed verification.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_VerifyCardValidationData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/VerifyCardValidationData) 

# VerifyMac
<a name="API_VerifyMac"></a>

Verifies a Message Authentication Code (MAC). 

You can use this operation to verify MAC for message data authentication such as . In this operation, you must use the same message data, secret encryption key and MAC algorithm that was used to generate MAC. You can use this operation to verify a DUPKT, CMAC, HMAC or EMV MAC by setting generation attributes and algorithm to the associated values. 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [GenerateMac](API_GenerateMac.md) 

## Request Syntax
<a name="API_VerifyMac_RequestSyntax"></a>

```
POST /mac/verify HTTP/1.1
Content-type: application/json

{
   "KeyIdentifier": "string",
   "Mac": "string",
   "MacLength": number,
   "MessageData": "string",
   "VerificationAttributes": { ... }
}
```

## URI Request Parameters
<a name="API_VerifyMac_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_VerifyMac_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [KeyIdentifier](#API_VerifyMac_RequestSyntax) **   <a name="paymentcryptographydata-VerifyMac-request-KeyIdentifier"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses to verify MAC data.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [Mac](#API_VerifyMac_RequestSyntax) **   <a name="paymentcryptographydata-VerifyMac-request-Mac"></a>
The MAC being verified.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 128.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [MacLength](#API_VerifyMac_RequestSyntax) **   <a name="paymentcryptographydata-VerifyMac-request-MacLength"></a>
The length of the MAC.  
Type: Integer  
Valid Range: Minimum value of 4. Maximum value of 16.  
Required: No

 ** [MessageData](#API_VerifyMac_RequestSyntax) **   <a name="paymentcryptographydata-VerifyMac-request-MessageData"></a>
The data on for which MAC is under verification. This value must be hexBinary.  
Type: String  
Length Constraints: Minimum length of 2. Maximum length of 8192.  
Pattern: `(?:[0-9a-fA-F][0-9a-fA-F])+`   
Required: Yes

 ** [VerificationAttributes](#API_VerifyMac_RequestSyntax) **   <a name="paymentcryptographydata-VerifyMac-request-VerificationAttributes"></a>
The attributes and data values to use for MAC verification within AWS Payment Cryptography.  
Type: [MacAttributes](API_MacAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

## Response Syntax
<a name="API_VerifyMac_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "KeyArn": "string",
   "KeyCheckValue": "string"
}
```

## Response Elements
<a name="API_VerifyMac_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [KeyArn](#API_VerifyMac_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyMac-response-KeyArn"></a>
The `keyARN` of the encryption key that AWS Payment Cryptography uses for MAC verification.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [KeyCheckValue](#API_VerifyMac_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyMac-response-KeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_VerifyMac_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

 ** VerificationFailedException **   
This request failed verification.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_VerifyMac_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/VerifyMac) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/VerifyMac) 

# VerifyPinData
<a name="API_VerifyPinData"></a>

Verifies pin-related data such as PIN and PIN Offset using algorithms including VISA PVV and IBM3624. For more information, see [Verify PIN data](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-pin-data.html) in the * AWS Payment Cryptography User Guide*.

This operation verifies PIN data for user payment card. A card holder PIN data is never transmitted in clear to or from AWS Payment Cryptography. This operation uses PIN Verification Key (PVK) for PIN or PIN Offset generation and then encrypts it using PIN Encryption Key (PEK) to create an `EncryptedPinBlock` for transmission from AWS Payment Cryptography. 

For information about valid keys for this operation, see [Understanding key attributes](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html) and [Key types for specific data operations](https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html) in the * AWS Payment Cryptography User Guide*. 

 **Cross-account use**: This operation can't be used across different AWS accounts.

 **Related operations:** 
+  [GeneratePinData](API_GeneratePinData.md) 
+  [TranslatePinData](API_TranslatePinData.md) 

## Request Syntax
<a name="API_VerifyPinData_RequestSyntax"></a>

```
POST /pindata/verify HTTP/1.1
Content-type: application/json

{
   "DukptAttributes": { 
      "DukptDerivationType": "string",
      "KeySerialNumber": "string"
   },
   "EncryptedPinBlock": "string",
   "EncryptionKeyIdentifier": "string",
   "EncryptionWrappedKey": { 
      "KeyCheckValueAlgorithm": "string",
      "WrappedKeyMaterial": { ... }
   },
   "PinBlockFormat": "string",
   "PinDataLength": number,
   "PrimaryAccountNumber": "string",
   "VerificationAttributes": { ... },
   "VerificationKeyIdentifier": "string"
}
```

## URI Request Parameters
<a name="API_VerifyPinData_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_VerifyPinData_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [DukptAttributes](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-DukptAttributes"></a>
The attributes and values for the DUKPT encrypted PIN block data.  
Type: [DukptAttributes](API_DukptAttributes.md) object  
Required: No

 ** [EncryptedPinBlock](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-EncryptedPinBlock"></a>
The encrypted PIN block data that AWS Payment Cryptography verifies.  
Type: String  
Length Constraints: Minimum length of 16. Maximum length of 32.  
Pattern: `[0-9a-fA-F]+`   
Required: Yes

 ** [EncryptionKeyIdentifier](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-EncryptionKeyIdentifier"></a>
The `keyARN` of the encryption key under which the PIN block data is encrypted. This key type can be PEK or BDK.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

 ** [EncryptionWrappedKey](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-EncryptionWrappedKey"></a>
Parameter information of a WrappedKeyBlock for encryption key exchange.  
Type: [WrappedKey](API_WrappedKey.md) object  
Required: No

 ** [PinBlockFormat](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-PinBlockFormat"></a>
The PIN encoding format for pin data generation as specified in ISO 9564. AWS Payment Cryptography supports `ISO_Format_0` and `ISO_Format_3`.  
The `ISO_Format_0` PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.  
The `ISO_Format_3` PIN block format is the same as `ISO_Format_0` except that the fill digits are random values from 10 to 15.  
Type: String  
Valid Values: `ISO_FORMAT_0 | ISO_FORMAT_1 | ISO_FORMAT_3 | ISO_FORMAT_4`   
Required: Yes

 ** [PinDataLength](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-PinDataLength"></a>
The length of PIN being verified.  
Type: Integer  
Valid Range: Minimum value of 4. Maximum value of 12.  
Required: No

 ** [PrimaryAccountNumber](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-PrimaryAccountNumber"></a>
The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.  
Type: String  
Length Constraints: Minimum length of 12. Maximum length of 19.  
Pattern: `[0-9]+`   
Required: No

 ** [VerificationAttributes](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-VerificationAttributes"></a>
The attributes and values for PIN data verification.  
Type: [PinVerificationAttributes](API_PinVerificationAttributes.md) object  
 **Note: **This object is a Union. Only one member of this object can be specified or returned.  
Required: Yes

 ** [VerificationKeyIdentifier](#API_VerifyPinData_RequestSyntax) **   <a name="paymentcryptographydata-VerifyPinData-request-VerificationKeyIdentifier"></a>
The `keyARN` of the PIN verification key.  
Type: String  
Length Constraints: Minimum length of 7. Maximum length of 322.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+`   
Required: Yes

## Response Syntax
<a name="API_VerifyPinData_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "EncryptionKeyArn": "string",
   "EncryptionKeyCheckValue": "string",
   "VerificationKeyArn": "string",
   "VerificationKeyCheckValue": "string"
}
```

## Response Elements
<a name="API_VerifyPinData_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [EncryptionKeyArn](#API_VerifyPinData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyPinData-response-EncryptionKeyArn"></a>
The `keyARN` of the PEK that AWS Payment Cryptography uses for encrypted pin block generation.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [EncryptionKeyCheckValue](#API_VerifyPinData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyPinData-response-EncryptionKeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

 ** [VerificationKeyArn](#API_VerifyPinData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyPinData-response-VerificationKeyArn"></a>
The `keyARN` of the PIN encryption key that AWS Payment Cryptography uses for PIN or PIN Offset verification.  
Type: String  
Length Constraints: Minimum length of 70. Maximum length of 150.  
Pattern: `arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}` 

 ** [VerificationKeyCheckValue](#API_VerifyPinData_ResponseSyntax) **   <a name="paymentcryptographydata-VerifyPinData-response-VerificationKeyCheckValue"></a>
The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.  
 AWS Payment Cryptography computes the KCV according to the CMAC specification.  
Type: String  
Length Constraints: Minimum length of 4. Maximum length of 16.  
Pattern: `[0-9a-fA-F]+` 

## Errors
<a name="API_VerifyPinData_Errors"></a>

 ** AccessDeniedException **   
You do not have sufficient access to perform this action.  
HTTP Status Code: 403

 ** InternalServerException **   
The request processing has failed because of an unknown error, exception, or failure.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The request was denied due to an invalid resource error.    
 ** ResourceId **   
The resource that is missing.
HTTP Status Code: 404

 ** ThrottlingException **   
The request was denied due to request throttling.  
HTTP Status Code: 429

 ** ValidationException **   
The request was denied due to an invalid request error.    
 ** fieldList **   
The request was denied due to an invalid request error.
HTTP Status Code: 400

 ** VerificationFailedException **   
This request failed verification.    
 ** Reason **   
The reason for the exception.
HTTP Status Code: 400

## See Also
<a name="API_VerifyPinData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/payment-cryptography-data-2022-02-03/VerifyPinData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/payment-cryptography-data-2022-02-03/VerifyPinData) 