Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?

前端 未结 10 2183
梦谈多话
梦谈多话 2020-11-28 02:54

What are the possible client-side architectures to access a local Smart Card from a generic browser (connected to a server through http(s)), preferably from Javascript, with

相关标签:
10条回答
  • 2020-11-28 03:37

    I have just released a beta plugin addressing this problem. This beta code is available here:

    https://github.com/ubinity/webpcsc-firebreath

    This plugin is based on the firebreath framework and has been beta-tested with Fireofx and Chrome under Linux/WinXP/Win7. Source code and extension pack are provided.

    The basic idea is to provide a PCSLite API access and then develop a more friendly JS-api on top of this.

    This plugin is under active development, so feel free to send any report and request.

    0 讨论(0)
  • 2020-11-28 03:39

    Update (8/2016): A new API for the Web called WebUSB API is being discussed. You can already use it with Chrome v54+.

    This standard will be implemented in all major browsers and will replace the need for third-party applications or extensions for Smard Cards :-)

    So the new answer is YES!

    And the OSI-like architecture stack is:

    • PC/SC
    • CCID v1.1
    • WebUSB API
    • USB driver, i.e. libusb.

    2019 Update: As @vlp commented, it seems that it doesn't work any in Chrome because they decided to block WebUSB for smartcards for some specious reasons :-(


    Note: Google annonced that they will abandon Chrome Apps in 2017.

    Previous anwser:

    Now (2015) you can create a Google Chrome App, using the chrome.usb API.

    Then you access the smartcard reader via its CCID-compliant interface.

    It's not cross-browser but JavaScript programmable & cross-platform.

    Anyway Netscape Plugin API (NPAPI) is not supported any more by modern browsers. And Java applets are being dismissed by browser vendors.

    0 讨论(0)
  • 2020-11-28 03:40

    Speaking about Chrome, you can now use the Smart Card Connector app provided by Google which bundles the PC/SC-Lite port and the generic CCID driver.

    The app itself works through the chrome.usb API, that was mentioned by the previous commenters.

    So, instead of rewriting the whole stack (starting from the lowest level - raw USB), it's now possible for developers to code only the part that works on top of PC/SC API - which is exposed by the Connector app.

    0 讨论(0)
  • 2020-11-28 03:43

    I have a setup where a smartcard reader is scanned to login a user. The PC/SC library work great on desktop. Somebody had mentioned to use Emscripten (https://github.com/kripken/emscripten) compiler which compiles c++ into JavaScript code. But that didn't work well because some of the functions being used by PC/SC are only available server side. After much research. I finally gave up on a client side solution, chrome web usb API also couldn't recognize the reader.
    I then decided to give signalR a try and set up a hub on the PC connected to the smartcard reader and this approach worked out very well.

    0 讨论(0)
提交回复
热议问题