4

I want to get information from the smart card. I want to do it on the browser. I already have a local solution which I used python with pyscard library mostly. How can I get the information out of smartcard on the browser? Browser does not matter I just need a browser-based or maybe the web-based solution

Thanks

Klaus D.
  • 13,874
  • 5
  • 41
  • 48
Zek'i B. Ulu
  • 77
  • 1
  • 8
  • 3
    This is complicated, since browsers typically use PKCS#11 interface, which has a quite restricted functionality. For a rough idea see [this question](https://stackoverflow.com/q/15807038/1435475). – guidot Jul 11 '18 at 08:22
  • 1
    You might want to explore [FortifyApp](https://fortifyapp.com/) – pepo Jul 11 '18 at 15:09
  • Possible duplicate of [Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?](https://stackoverflow.com/questions/15807038/architectures-to-access-smart-card-from-a-generic-browser-or-how-to-bridge-the) – vlp Aug 06 '18 at 06:55

2 Answers2

0

By my understanding local solution works because Pyscard has access to host machine and can perform some low level operations.
While browser has restricted access and can't perform these actions.

I found some relevant info here

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
Narendra
  • 11
  • 4
  • You thought that this should be a comment (for which you do not have the privilege yet). Please do not misuse answer posts for comments in that situation. HOWEVER, this post I consider to be a partial answer, i.e. some contribution to the answering process while no full answer exists. And that is an appreciated contribution. That is why I tried my best to polish it up into a more obvious partial answer - and it got undeleted. The difference is not easy, but this one is good enough. Have fun. – Yunnosch Jun 18 '21 at 07:38
0

To get information from card readers these are available options

1-ActiveX (not recomended)

  • ActiveX component that loads inside internet explorer and contains API’s that can be consumed using JavaScript code

  • it is only supported in IE browser and Microsoft stops support for internet explorer that mean IE will die in a short time

2-Applet (not recomended)

  • Develop an applet that communicates with the local device and interact with the applet using javascript
  • Require to configure java run time in the browser.

3-Create host application that runs locally to communicate with devices and send a response to the browser over a web socket (recommended)

  • This method is preferred since the web socket is supported by all browser versions and didn’t require any extra configuration
  • Also inside the host application you can execute any complex operation without any limitation.
  • I have attached a sample for host application C# sample on this repository
MHassan
  • 415
  • 4
  • 9