lme*_*ier 5 google-chrome smartcard-reader webusb
我正在开发一个JavaScript库,以通过chrome webusb API使用CCID协议执行智能卡操作。当我在Linux和MacOS上插入智能卡读卡器时,一切都会顺利进行,但是当尝试声明该接口时,我却卡在了Windows上。我试图以管理员身份运行chrome,在Windows上禁用智能卡服务/ CCID驱动程序,以防万一有人声称该接口,但是却无济于事。我一直显示“无法声明接口:访问被拒绝(权限不足)”消息。这真的是权限问题吗?还是我不知道阻止某些Windows服务访问?
编辑:我尝试在另一台Mac,读者无法正常工作。从CCID驱动程序info.plist中删除了特定的供应商ID /产品ID之后,我设法使其工作。所以我想在Windows上也会发生同样的问题,一个CCID驱动程序正在“阻塞”访问接口。我有什么选择?
设备描述符:
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a44 VASCO Data Security International
idProduct 0x0001 Digipass 905 SmartCard Reader
bcdDevice 1.02
iManufacturer 1 VASCO
iProduct 2 DP905v1.1
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 93
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 50mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 11 Chip/SmartCard
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
ChipCard Interface Descriptor:
bLength 54
bDescriptorType 33
bcdCCID 1.00
nMaxSlotIndex 0
bVoltageSupport 3 5.0V 3.0V
dwProtocols 3 T=0 T=1
dwDefaultClock 3700
dwMaxiumumClock 3700
bNumClockSupported 1
dwDataRate 9946 bps
dwMaxDataRate 318280 bps
bNumDataRatesSupp. 53
dwMaxIFSD 254
dwSyncProtocols 00000007 2-wire 3-wire I2C
dwMechanical 00000000
dwFeatures 000404BE
Auto configuration based on ATR
Auto activation on insert
Auto voltage selection
Auto clock change
Auto baud rate change
Auto PPS made by CCID
Auto IFSD exchange
Short and extended APDU level exchange
dwMaxCCIDMsgLen 272
bClassGetResponse echo
bClassEnvelope echo
wlcdLayout none
bPINSupport 0
bMaxCCIDBusySlots 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 32
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 0
Run Code Online (Sandbox Code Playgroud)
您编辑中的洞察是正确的,如果CCID驱动程序阻止了对该设备的访问,则Chrome无法访问它。此外,在Windows上,操作系统必须知道如何将WinUSB.sys驱动程序(Windows附带)加载到设备上,否则任何用户空间应用程序(例如Chrome)都无法访问它。这可以通过使用像这样的INF文件或通过将Microsoft OS描述符添加到设备以将“兼容ID”设置为“ WINUSB”来实现。
如果您要构建自己的设备,则最好选择后者,因为它将为您的用户提供即插即用的支持,而前者仍然需要Windows用户手动安装。
如果使用的是现有设备,但可以控制Windows系统,则类似于编辑macOS驱动程序的Info.plist,可以进入Windows设备管理器,并使用INF文件将现有驱动程序替换为WinUSB.sys。像上面一样。