This command is used to authenticate the user by verifying their PIN. A successful verification authenticates the session until the card is deselected, reset, or a signature command is performed.
def verify_pin(pin: str)
card.verify_pin(pin)
For example, verify_pin("123456789")
Application Protocol Data Unit (APDU) Components
The following table outlines the components of the Application Protocol Data Unit (APDU).
Field | Description | Value |
CLA | This field specifies the class of the instruction. | 0x80 |
INS | This field specifies the particular command or operation that the smart card or secure element should execute. | 0x20 |
P1 | First parameter of the instruction that specifies the details about the operation being requested. | 0x00 |
P2 | First parameter of the instruction that specifies additional details about the operation being requested. | 0x00 |
Data | PIN data (optional) | None, or the PIN (4–9 digits, zero-padded to 9) |
Â
📘 Note
Â
Input Validation Rules
Â
Response
The following table outlines the possible responses that you will receive:
Response Code | Description |
0x9000 | PIN verified successfully. PIN is now authenticated for the session. The retry counter is reset. |
0x63Cx | Wrong PIN. x = remaining retries. |
0x63C0 | No retries left in this power cycle (PIN locked until reset). Even the correct PIN returns this code. If persists after the power cycle → PIN is blocked, must use UNBLOCK PIN. |
0x6700 | Incorrect data length (PIN not 4–9 digits or padding error). |
0x6986 | Card not initialized, no PIN provided, or PIN authentication disabled (via SetPinAuth). |