> 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/home/card-creation-and-management/display-pin.md).

# Display PIN

This section describes how to display the card PIN securely.

D1 currently supports **PIN block ISO 0** returned by the **issuer backend**.

### User Experience

<figure><img src="https://1511816349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrnGS7C0Nw9iutILsGHpC%2Fuploads%2FQXfNTYTbHH2DLsX1HrP9%2FUX%20-%20Display%20card%20details.svg?alt=media&amp;token=ed032212-96ca-4342-8644-4708b52d620c" alt=""><figcaption><p>Sample PIN display screen in the Issuer Application</p></figcaption></figure>

### Flow

<figure><img src="https://1511816349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrnGS7C0Nw9iutILsGHpC%2Fuploads%2F2FOOBpIQqDzE52c7JylK%2Fimage.png?alt=media&amp;token=01a46b07-7a27-494d-90e1-14c9474d7bb0" alt=""><figcaption></figcaption></figure>

1. **End user** authenticates in the **issuer application** and requests the PIN.
2. Issuer application calls the D1 SDK PIN display method.
3. D1 SDK calls the **D1 backend** “Get PIN” API.
4. D1 backend prepare the PIN block .
5. D1 backend **transciphers** the PIN block from issuer keys to device keys.
6. SDK displays the PIN in a secure UI for a limited time.

### Sequence Diagram

#### Pre-requisites

* End user, account and card already registered in D1
* SDK is properly initialized
* Issuer App called D1 SDK login API.

<figure><img src="https://1511816349-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrnGS7C0Nw9iutILsGHpC%2Fuploads%2FmFqYIMcJZFTWGmzhw5SW%2Fimage.png?alt=media&amp;token=abf9a6f4-6ae6-4757-9645-ec8bda15640b" alt=""><figcaption></figcaption></figure>

`CardPINUI` contains `PINDisplayTextView` (Android) and `D1PINDisplayTextField` (iOS), which inherit from the native [TextView](https://developer.android.com/reference/android/widget/TextView) and [UITextField](https://developer.apple.com/documentation/uikit/uitextfield). Text field configuration (font, size, color) can be done using these native objects properties.

### Security and compliance

* PIN display occur in a secure, tamper‑resistant UI.
* PIN data is not persisted on the device.
* Data exchange is encrypted end‑to‑end.
* Solution is designed to be PCI DSS compliant for PIN handling.

### SDK

{% tabs %}
{% tab title="Androïd" %}

```java
PINDisplayTextView pinDisplayTextView = <Object of type PINDisplayTextView>;
CardPINUI ui = new CardPINUI(pinDisplayTextView);
String cardID = "<Card ID>";

d1Task.displayPhysicalCardPIN(cardID, ui, new D1Task.Callback<Void>() {
    @Override
    public void onSuccess(Void data) {
        // Proceed with subsequent flows, the PIN is now being displayed on the text view provided.
    }
    
    @Override
    public void onError(D1Exception exception) {
        // Refer to D1 SDK Integration – Error Management section
    }
});
```

{% endtab %}

{% tab title="iOS" %}

```swift
let displayTextField = <Object of type D1PINDisplayTextField>
let cardPINUI = CardPINUI(pinTextField: displayTextField)
let cardID = <Card ID>

d1Task.displayPhysicalCardPIN(cardID, cardPINUI: cardPINUI) { error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section
    } else {
        // Proceed with subsequent flows, the PIN is now being displayed on the text field provided.
    }
}In
```

{% endtab %}
{% endtabs %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/home/card-creation-and-management/display-pin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
