45#define SCARD_ATTR_VALUE(Class, Tag) ((((ULONG)(Class)) << 16) | ((ULONG)(Tag)))
47#define SCARD_CLASS_VENDOR_INFO 1
48#define SCARD_CLASS_COMMUNICATIONS 2
49#define SCARD_CLASS_PROTOCOL 3
50#define SCARD_CLASS_POWER_MGMT 4
51#define SCARD_CLASS_SECURITY 5
52#define SCARD_CLASS_MECHANICAL 6
53#define SCARD_CLASS_VENDOR_DEFINED 7
54#define SCARD_CLASS_IFD_PROTOCOL 8
55#define SCARD_CLASS_ICC_STATE 9
56#define SCARD_CLASS_SYSTEM 0x7fff
58#define SCARD_ATTR_VENDOR_NAME SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0100)
59#define SCARD_ATTR_VENDOR_IFD_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0101)
60#define SCARD_ATTR_VENDOR_IFD_VERSION SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0102)
61#define SCARD_ATTR_VENDOR_IFD_SERIAL_NO SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_INFO, 0x0103)
62#define SCARD_ATTR_CHANNEL_ID SCARD_ATTR_VALUE(SCARD_CLASS_COMMUNICATIONS, 0x0110)
63#define SCARD_ATTR_ASYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0120)
64#define SCARD_ATTR_DEFAULT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0121)
65#define SCARD_ATTR_MAX_CLK SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0122)
66#define SCARD_ATTR_DEFAULT_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0123)
67#define SCARD_ATTR_MAX_DATA_RATE SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0124)
68#define SCARD_ATTR_MAX_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0125)
69#define SCARD_ATTR_SYNC_PROTOCOL_TYPES SCARD_ATTR_VALUE(SCARD_CLASS_PROTOCOL, 0x0126)
70#define SCARD_ATTR_POWER_MGMT_SUPPORT SCARD_ATTR_VALUE(SCARD_CLASS_POWER_MGMT, 0x0131)
71#define SCARD_ATTR_USER_TO_CARD_AUTH_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0140)
72#define SCARD_ATTR_USER_AUTH_INPUT_DEVICE SCARD_ATTR_VALUE(SCARD_CLASS_SECURITY, 0x0142)
73#define SCARD_ATTR_CHARACTERISTICS SCARD_ATTR_VALUE(SCARD_CLASS_MECHANICAL, 0x0150)
75#define SCARD_ATTR_CURRENT_PROTOCOL_TYPE SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0201)
76#define SCARD_ATTR_CURRENT_CLK SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0202)
77#define SCARD_ATTR_CURRENT_F SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0203)
78#define SCARD_ATTR_CURRENT_D SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0204)
79#define SCARD_ATTR_CURRENT_N SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0205)
80#define SCARD_ATTR_CURRENT_W SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0206)
81#define SCARD_ATTR_CURRENT_IFSC SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0207)
82#define SCARD_ATTR_CURRENT_IFSD SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0208)
83#define SCARD_ATTR_CURRENT_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x0209)
84#define SCARD_ATTR_CURRENT_CWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020a)
85#define SCARD_ATTR_CURRENT_EBC_ENCODING SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020b)
86#define SCARD_ATTR_EXTENDED_BWT SCARD_ATTR_VALUE(SCARD_CLASS_IFD_PROTOCOL, 0x020c)
88#define SCARD_ATTR_ICC_PRESENCE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0300)
89#define SCARD_ATTR_ICC_INTERFACE_STATUS SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0301)
90#define SCARD_ATTR_CURRENT_IO_STATE SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0302)
91#define SCARD_ATTR_ATR_STRING SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0303)
92#define SCARD_ATTR_ICC_TYPE_PER_ATR SCARD_ATTR_VALUE(SCARD_CLASS_ICC_STATE, 0x0304)
94#define SCARD_ATTR_ESC_RESET SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA000)
95#define SCARD_ATTR_ESC_CANCEL SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA003)
96#define SCARD_ATTR_ESC_AUTHREQUEST SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA005)
97#define SCARD_ATTR_MAXINPUT SCARD_ATTR_VALUE(SCARD_CLASS_VENDOR_DEFINED, 0xA007)
99#define SCARD_ATTR_DEVICE_UNIT SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0001)
100#define SCARD_ATTR_DEVICE_IN_USE SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0002)
101#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0003)
102#define SCARD_ATTR_DEVICE_SYSTEM_NAME_A SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0004)
103#define SCARD_ATTR_DEVICE_FRIENDLY_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0005)
104#define SCARD_ATTR_DEVICE_SYSTEM_NAME_W SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0006)
105#define SCARD_ATTR_SUPRESS_T1_IFS_REQUEST SCARD_ATTR_VALUE(SCARD_CLASS_SYSTEM, 0x0007)
108#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_W
109#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_W
111#define SCARD_ATTR_DEVICE_FRIENDLY_NAME SCARD_ATTR_DEVICE_FRIENDLY_NAME_A
112#define SCARD_ATTR_DEVICE_SYSTEM_NAME SCARD_ATTR_DEVICE_SYSTEM_NAME_A
118#define SCARD_CTL_CODE(code) (0x42000000 + (code))
123#define CM_IOCTL_GET_FEATURE_REQUEST SCARD_CTL_CODE(3400)
125#define FEATURE_VERIFY_PIN_START 0x01
126#define FEATURE_VERIFY_PIN_FINISH 0x02
127#define FEATURE_MODIFY_PIN_START 0x03
128#define FEATURE_MODIFY_PIN_FINISH 0x04
129#define FEATURE_GET_KEY_PRESSED 0x05
130#define FEATURE_VERIFY_PIN_DIRECT 0x06
131#define FEATURE_MODIFY_PIN_DIRECT 0x07
132#define FEATURE_MCT_READER_DIRECT 0x08
133#define FEATURE_MCT_UNIVERSAL 0x09
134#define FEATURE_IFD_PIN_PROPERTIES 0x0A
135#define FEATURE_ABORT 0x0B
136#define FEATURE_SET_SPE_MESSAGE 0x0C
137#define FEATURE_VERIFY_PIN_DIRECT_APP_ID 0x0D
138#define FEATURE_MODIFY_PIN_DIRECT_APP_ID 0x0E
139#define FEATURE_WRITE_DISPLAY 0x0F
140#define FEATURE_GET_KEY 0x10
141#define FEATURE_IFD_DISPLAY_PROPERTIES 0x11
142#define FEATURE_GET_TLV_PROPERTIES 0x12
143#define FEATURE_CCID_ESC_COMMAND 0x13
144#define FEATURE_EXECUTE_PACE 0x20
153#if defined(__APPLE__) || defined(sun) || defined(__NetBSD__)
169#define HOST_TO_CCID_16(x) (x)
170#define HOST_TO_CCID_32(x) (x)
192 uint8_t bTeoPrologue[3];
195#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
231 uint8_t bTeoPrologue[3];
234#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
245 uint8_t bEntryValidationCondition;
250#if defined(__APPLE__) || defined(sun) || defined(__NetBSD__)
257#define PCSCv2_PART10_PROPERTY_wLcdLayout 1
258#define PCSCv2_PART10_PROPERTY_bEntryValidationCondition 2
259#define PCSCv2_PART10_PROPERTY_bTimeOut2 3
260#define PCSCv2_PART10_PROPERTY_wLcdMaxCharacters 4
261#define PCSCv2_PART10_PROPERTY_wLcdMaxLines 5
262#define PCSCv2_PART10_PROPERTY_bMinPINSize 6
263#define PCSCv2_PART10_PROPERTY_bMaxPINSize 7
264#define PCSCv2_PART10_PROPERTY_sFirmwareID 8
265#define PCSCv2_PART10_PROPERTY_bPPDUSupport 9
266#define PCSCv2_PART10_PROPERTY_dwMaxAPDUDataSize 10
267#define PCSCv2_PART10_PROPERTY_wIdVendor 11
268#define PCSCv2_PART10_PROPERTY_wIdProduct 12
the structure must be 6-bytes long
uint32_t value
This value is always in BIG ENDIAN format as documented in PCSC v2 part 10 ch 2.2 page 2.
structure used with FEATURE_MODIFY_PIN_DIRECT
uint8_t bmPINLengthFormat
bits 7-5 RFU, bit 4 set if system units are bytes, clear if system units are bits,...
uint8_t bInsertionOffsetOld
Insertion position offset in bytes for the current PIN.
uint8_t bConfirmPIN
Flags governing need for confirmation of new PIN.
uint8_t bmFormatString
formatting options
uint8_t bTimerOut
timeout is seconds (00 means use default timeout)
uint16_t wPINMaxExtraDigit
0xXXYY where XX is minimum PIN size in digits, and YY is maximum PIN size in digits
uint8_t bmPINBlockString
bits 7-4 bit size of PIN length in APDU, bits 3-0 PIN block size in bytes after justification and for...
uint16_t wLangId
Language for messages.
uint8_t bNumberMessage
Number of messages to display for PIN verification.
uint8_t bMsgIndex3
index of 3d prompting message
uint32_t ulDataLength
length of Data to be sent to the ICC
uint8_t bTimerOut2
timeout in seconds after first key stroke
uint8_t bInsertionOffsetNew
Insertion position offset in bytes for the new PIN.
uint8_t bEntryValidationCondition
Conditions under which PIN entry should be considered complete.
uint8_t bMsgIndex2
index of 2d prompting message
uint8_t bMsgIndex1
index of 1st prompting message
structure used with FEATURE_IFD_PIN_PROPERTIES
uint16_t wLcdLayout
display characteristics
structure used with FEATURE_VERIFY_PIN_DIRECT
uint8_t bmPINLengthFormat
bits 7-5 RFU, bit 4 set if system units are bytes, clear if system units are bits,...
uint8_t bMsgIndex
Message index (should be 00)
uint8_t bmFormatString
formatting options
uint8_t bTimerOut
timeout is seconds (00 means use default timeout)
uint16_t wPINMaxExtraDigit
0xXXYY where XX is minimum PIN size in digits, and YY is maximum PIN size in digits
uint8_t bmPINBlockString
bits 7-4 bit size of PIN length in APDU, bits 3-0 PIN block size in bytes after justification and for...
uint16_t wLangId
Language for messages.
uint8_t bNumberMessage
Number of messages to display for PIN verification.
uint32_t ulDataLength
length of Data to be sent to the ICC
uint8_t bTimerOut2
timeout in seconds after first key stroke
uint8_t bEntryValidationCondition
Conditions under which PIN entry should be considered complete.