> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/xpay-enablement/data-preparation/apple-pay-personalization.md).

# Apple Pay personalization

The TSH is fully capable of personalizing an EMV application that is based on IRON applet for Apple Pay solution. Here is the set of data required from the TSP in the 'submitTokenData' operation.

| Name                              | Format       | Length | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Example                                            |
| --------------------------------- | ------------ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| KEK\_label                        | ASCII string | 1-64   | Label of the key used for CMKs encryption. The value is defined during the key ceremony.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | "G062C.TEST.SGKEK.KEK.01"                          |
| KEK\_kcv                          | Hexa string  | 6      | KCV of the key used for CMK encryption.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | "E95500"                                           |
| DEK\_label                        | ASCII string | 1-64   | Label of the key used for Track2 Data ("Track2\_Data\_under\_DEK") encryption. The value is defined during the key ceremony.                                                                                                                                                                                                                                                                                                                                                                                                                                                           | "G062C.TEST.SGDEK.MKDATA.01"                       |
| DEK\_kcv                          | Hexa string  | 6      | KCV of the DEK key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | "50FE57"                                           |
| Card\_Master\_Key\_Under\_KEK     | Hexa string  | -      | Value of the Application Cryptogram Card Master Key for proximity payment ciphered under the KEK key. Encryption algorithm is defined during project setup.                                                                                                                                                                                                                                                                                                                                                                                                                            | "F1452589A51C5E88FA451236A5C49687"                 |
| CMK\_kcv                          | Hexa string  | 6      | Value of the KCV of the Application Cryptogram Card Master Key for proximity payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | "4A56F8"                                           |
| CMK\_dki                          | Hexa string  | 2      | Value of the Derivation Key index associated to the Application Cryptogram Card Master Key for proximity payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | "01"                                               |
| Card\_Master\_Key\_RP\_Under\_KEK | Hexa string  | -      | Value of the Application Cryptogram Card Master Key for remote payment ciphered under the KEK key. Encryption algorithm is defined during project setup.                                                                                                                                                                                                                                                                                                                                                                                                                               | "E5812624B11DE846AA452165C4C39154"                 |
| CMK\_RP\_kcv                      | Hexa string  | 6      | Value of the KCV of the AC Card Master Key for remote payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | "5E23C1"                                           |
| CMK\_RP\_dki                      | Hexa string  | 2      | Value of the Derivation Key index associated to the AC Card Master Key for remote payment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | "01"                                               |
| Track2\_Data\_under\_DEK          | Hexa string  | -      | <p>Track 2 Equivalent Data (max length is 19 bytes)<br>Format in clear is:<br></p><ul><li>Token PAN up to 19 digits: 'ppppppppppppppppppp'</li><li>'D'</li><li>Expiry date: 'yymm'</li><li>Service code: 'sss'</li><li>(optional) Discretionary data (depending on PAN length)</li><li>'F' (if needed to ensure whole byte)<br><br>track2 data is padded with 80h + 00h..00h in order to reach encryption algorithm block size (ISO7816-4 padding)<br><br>track2 data is ciphered under the DEK key using CBC mode.<br>Encryption algorithm is defined during project setup.</li></ul> | "FAB7FF4EFE1989AC25EBBEC2ED72378BDA79D244B89F7F25" |
| PAN\_Sequence\_Number             | Hexa string  | 2      | PAN Sequence Number to personalize in the application.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | "01"                                               |
| app\_preferred\_name              | ASCII bytes  | max 16 | Application preferred name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | <p>"4465626974"<br>which represents "Debit"</p>    |

{% hint style="info" %}
**Note1**:

The data element name is case insensitive.\
For example, DEK\_KCV and dek\_kcv are equivalent
{% endhint %}

{% hint style="info" %}
**Note2**:

Additional data elements may be added upon project configuration
{% endhint %}

{% hint style="info" %}
**Note3**:

All KCVs described above are calculated by encrypting 8 bytes of 00h for 3DES keys or 16 bytes of 01h for AES keys with the related key using ECB mode.\
In both cases, the 3 high-order bytes shall be used as KCV.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/xpay-enablement/data-preparation/apple-pay-personalization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
