> 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/pin-management/implement-pin-management/display-a-pin.md).

# Display a 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="/files/uixZNJSzKkGZUFDdbNeT" alt=""><figcaption><p>Sample PIN display screen in the Issuer Application</p></figcaption></figure>

### Flow

<figure><img src="/files/bAwvEIQJI0qYkQIbPDUN" alt=""><figcaption><p>High-level flow to display a PIN</p></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 requests the PIN block from the **issuer backend** (D1 does not store PINs).
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.
* Issuer backend exposes the “Get PIN” endpoint and returns **PIN block ISO 0**.

<figure><img src="/files/WJ1uLRucsBbsJbmJR6nu" alt=""><figcaption><p>Sequence diagram for PIN display</p></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.

### Required APIs

| API                                                                                                                                                          | Inbound/Outbound    | Description                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | -------------------------------------------------------------------------- |
| [Get PIN](/pin-management/integrate-the-d1-api/d1-api-reference/outbound-api-from-d1/pin-management-api.md#get-cms-api-v1-issuers-issuerid-cards-cardid-pin) | Issuer <- Thales D1 | Retrieve the PIN from Issuer backend in order to display it on the mobile. |

### 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 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/pin-management/implement-pin-management/display-a-pin.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.
