[Pcsclite-muscle] Web smartcard access (?)

Ludovic Rousseau ludovic.rousseau at gmail.com
Fri Jun 16 08:27:51 PDT 2023


Le ven. 16 juin 2023 à 15:34, Sebastien Lorquet <sebastien at lorquet.fr> a écrit :
>
> Hi all,

Hello Sebastien,

> For a time in the Past, it was possible to enumerate smart card readers
> and to exchange APDUs with smart card from various web extensions, both
> in internet explorer (via ActiveX crimes) or in firefox (via XPCOM crimes).
>
> Browsers got updated, Chrome won it all, and now it's all gone.
>
> So is it still possible to access smart card in a browser context in
> 2023 and how?
>
>
> Now, we have webassembly and webusb in chrome, maybe chromium. Firefox
> still does not have it.
>
> And I wonder if pcsclite, in a form executable from browser context,
> could be compiled to webassembly with a webusb backend so we can do
> smartcards in the browser again?
>
> Clearly the full pcscd daemon + libpcsc library is not workable... but
> something could be, with shortcuts?
>
> I am clearly incompetent to design all of this but if someone else was
> curious enough to try... some others people would use this, including me.

Instead of porting pcsc-lite to webassembly I suggest to port libccid instead.
If you need to access only 1 card from 1 application you do not need a
middleware like pcsc-lite.

What you need is an equivalent of CCID for UEFI but for webassembly + webusb
See "Updated CCID driver for UEFI"
https://blog.apdu.fr/posts/2022/11/updated-ccid-driver-for-uefi/

You may have access issues because:
- if pcsc-lite already uses the USB device then you can't open it
(again) from webusb
- by default CCID USB readers are accessible only by root. You will
have to configure a udev rule to give access to the user running the
browser (maybe not a good idea)


With Chrome you can use "Smart Card Connector"
https://chrome.google.com/webstore/detail/smart-card-connector/khpfeaanjngmcnplbdlpegiifgpfgdco

It was working in 2017 when I wrote "PC/SC sample in Smart Card
Connector on Chromebook"
https://blog.apdu.fr/posts/2017/03/pcsc-sample-in-smart-card-connector-on/
And the latest version is from Oct 2022 so it seams to be maintained.

I also found other smart card extensions in Chrome Web Store
https://chrome.google.com/webstore/search/smart%20card%20extension?_category=extensions

I think you already know "Web Smart Card"
https://github.com/WICG/web-smart-card

Bye


--
 Dr. Ludovic Rousseau



More information about the pcsclite-muscle mailing list