# PIN Management
source: https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/index.md

The use cases in this section provide various scenarios for implementing PIN management for full-PAN and PAN-less issuers.

The PIN for the card must be defined before ordering a physical card production. The PIN must be sent according to [ISO-9564](https://en.wikipedia.org/wiki/ISO_9564) standards using an encrypted PIN block in ISO format 0 or ISO format 1. The CMS never stores the PIN in clear text.

Depending on your PAN-related approach, there are two different sequence flows to set the PIN:

* [Set a PIN for full PAN Issuers](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/set-pin-full-pan-issuer/index.md)
* [Set a PIN for PAN-less Issuers](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/set-pin-pan-less-issuer/index.md)

Note: To successfully set a new PIN, `cardContract.statusCode` is `00` and `cardContract.productionStatus` is not `Marked`.

The CMS does not validate the old PIN, which means that you do not need to know the old PIN to set up the new PIN. However, if you want to implement a change PIN process where you require the cardholder to enter the current PIN before setting a new PIN, you can use Verify PIN use cases for that purpose:

* [Verify a PIN for Full PAN Issuers](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/verify-pin-full-pan-issuer/index.md)
* [Verify a PIN for PAN-less Issuers](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/verify-pin-pan-less-issuer/index.md)  

Each use case provides the following information:

* A brief description of the use case
* A sequence diagram
* A detailed explanation
* A part of the API specification with one or more endpoints used in the use case  

The following use cases are provided in this section:

|                                                                                   Use case                                                                                   |           OperationId           | Method |                          URI                          |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|--------|-------------------------------------------------------|
| [Set a PIN for a Full PAN Issuer](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/set-pin-full-pan-issuer/index.md)       | setPIN                          | PUT    | /cards/{card_contract_id}/pin                         |
| [Set a PIN for a PAN-less Issuer](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/set-pin-pan-less-issuer/index.md)       | getPublicRsaKey                 | POST   | /public-keys                                          |
|                                                                                                                                                                              | setPIN                          | PUT    | /cards/{card_contract_id}/pin                         |
| [Order a PIN Reprint](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/order-pin-reprint/index.md)                         | reissueCard                     | POST   | /cards/{card_contract_id}/plastics                    |
| [Verify a PIN for a Full PAN Issuer](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/verify-pin-full-pan-issuer/index.md) | verifyPIN                       | POST   | /cards/{card_contract_id}/pins/verifications          |
| [Verify a PIN for a PAN-less Issuer](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/verify-pin-pan-less-issuer/index.md) | getPublicRsaKey                 | POST   | /public-keys                                          |
|                                                                                                                                                                              | verifyPIN                       | POST   | /cards/{card_contract_id}/pins/verifications          |
| [Display a PIN](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/display-a-pin/index.md)                                   | getPIN                          | POST   | /cards/{card_contract_id}/pins/searches               |
| [Clear the online PIN try counter](https://developer.mastercard.com/mastercard-processing-core/documentation/use-cases/pin-management/clear-online-pin-try-counter/index.md) | clearOnlinePinAttemptsForClient | PUT    | /clients/{client_id}/online-pin-attempts-counter      |
|                                                                                                                                                                              | clearOnlinePinAttempts          | PUT    | /cards/{card_contract_id}/online-pin-attempts-counter |

