21#define USB_CLASS_CCID 0x0B
24#define CCID_USB_VID 0x08e6
25#define CCID_USB_PID 0x4433
28#define CCID_PC_TO_RDR_ICC_POWER_ON 0x62
29#define CCID_PC_TO_RDR_ICC_POWER_OFF 0x63
30#define CCID_PC_TO_RDR_GET_SLOT_STATUS 0x65
31#define CCID_PC_TO_RDR_XFR_BLOCK 0x6F
32#define CCID_PC_TO_RDR_GET_PARAMETERS 0x6C
33#define CCID_PC_TO_RDR_RESET_PARAMETERS 0x6D
34#define CCID_PC_TO_RDR_SET_PARAMETERS 0x61
35#define CCID_PC_TO_RDR_SECURE 0x69
38#define CCID_RDR_TO_PC_DATA_BLOCK 0x80
39#define CCID_RDR_TO_PC_SLOT_STATUS 0x81
40#define CCID_RDR_TO_PC_PARAMETERS 0x82
43#define CCID_ICC_PRESENT_ACTIVE 0x00
44#define CCID_ICC_PRESENT_INACTIVE 0x01
45#define CCID_ICC_NOT_PRESENT 0x02
48#define CCID_CMD_STATUS_OK 0x00
49#define CCID_CMD_STATUS_FAILED 0x40
50#define CCID_CMD_STATUS_TIME_EXT 0x80
53#define CCID_ERROR_CMD_ABORTED 0xFF
54#define CCID_ERROR_ICC_MUTE 0xFE
55#define CCID_ERROR_XFR_PARITY_ERROR 0xFD
56#define CCID_ERROR_XFR_OVERRUN 0xFC
57#define CCID_ERROR_HW_ERROR 0xFB
58#define CCID_ERROR_CMD_NOT_SUPPORTED 0x00
61#define CCID_MAX_MSG_SIZE 2048
62#define CCID_HEADER_SIZE 10
83 uint8_t *resp,
size_t resp_max);
int ccid_process_message(const uint8_t *msg, size_t msg_len, uint8_t *resp, size_t resp_max)
Processes one incoming CCID message and writes corresponding response.
bool ccid_card_present(void)
Returns whether virtual CCID card is available.
const uint8_t CCID_DESCRIPTOR[]
CCID functional descriptor (54 bytes) per OpenPGP 3.4.1 profile.
struct __attribute__((packed))
const uint8_t * ccid_get_atr(size_t *len)
Returns pointer and length of ATR bytes.
const size_t CCID_DESCRIPTOR_LEN