This command is used to retrieve structured metadata and user-defined content from the card’s secure memory. This includes card ownership details, cryptographic key source information, public keys, and any additional user-defined data written using the WRITE DATA command.
Table of Contents
Toggle
def get_card_info(pk_user_idx: int):
card.get_card_info(pk_user_idx)
# For example:
get_card_info(1)
📘
Note
- The secure channel must be open for all usages of this command. PIN or challenge-response authentication is required for reading key slots and user data slots (P2 > 0). d.
- PIN or challenge-response authentication is required for reading key slots and user data slots (P2 > 0).
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. | 0xFA |
P1 | First parameter of the instruction that specifies the details about the operation being requested. | 0x00 to 0x03 |
P2 | First parameter of the instruction that specifies additional details about the operation being requested. | 0x00 to 0x03 |
Data | Key data | None |
Condition | Data Value |
P1=0 & P2=0 | provides the following data :
Keys source info byte :
|
P1>0 (1-3) & P2=0 | Provides the 64 bytes description data and the public key user slot (64 bytes info + 65/256 bytes public key). This requires PIN or challenge-response. These data were provided with ADD USER KEY. |
P2=1,2,3 | Provides the data in the user data slot. This requires PIN or challenge-response. This is P2=1 increased by the page index (page is 1200 bytes long). This data was provided by the Write Data command 0xFC. |
📘
Note
When reading user data with this command, the command must be sent using the extended frame format header, to receive bigger than 256 bytes data (even if the command frame length is shorter). This is as expected by the ISO7816 standard.
The following table outlines the possible responses that you will receive:
Response Code | Description |
0x9000 | Success |
0x6985 | secure channel not opened or PIN/challenge not validated (P2=1) |
0x6B00 | invalid P1/P2 or user data slot reading out of range |