问题
I'm trying to write a web application which needs to exchange messages with a local Smart Card. Currently I'm trying to use WebUSB API to connect the Chrome with the smart card reader, but I'm struggling to use the PC/SC specification.
In my researches I found this two topics:
Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?
How to send APDU to PCSC reader from web broswer using javascript
Although they deal with the same subject, they have no connection examples.
If anyone has any tips or example of connection I would be grateful.
回答1:
I am not sure about WebUSB or other API but smartcard may be accessed using Chrome Browser Extension. One such extension is Signer.Digital Chrome Extension available on Chrome Web Store.
Windows Host for the same may be downloaded from here
You need device driver for smart card to be installed on the client PC for this extension to work.
JavaScript method calls for this is available on my other posts on SO.
来源:https://stackoverflow.com/questions/49739614/how-to-access-smart-card-from-a-chrome-browser-using-webusb-api-and-pc-sc