Primary reason for using a smart card reader was to access Croatian e-citizens portal with my eid. I had some issues doing this on Ubuntu, not really a plug and play even with extensive instructions from https://www.id.hr/...

Old school way, the waiting lines

I recently had to renew my passport, and learned that I could do that faster over the government ui e-građani. Otherwise, good old long waiting lines which I btw did, 4 hours waiting to submit an application for a passport renewal...

I didn't stay there for 4 hours, but still…
I stopped at "la Turka" for a cup of turkish coffee, went for a walk, went shopping, went to a restaurant, I returned and still waited...

There's also https://redomat.mup.hr/ where you can make a reservation or check how many people are in front of you.

When I finally got my turn, I submitted the application, and requested the credentials for eid, and with that credentials and a smart card reader I could activate my eid and get rid of the long waiting lines.

I bought a smart card reader for cca 17$ from https://www.instar-informatika.hr/citac-smart-kartica-usb-maxi-ponuda/74604/product/.

Any smart card reader will do, just has to comply with ISO7816 and PC/SC, and don't mind if it doesn't say that Linux is not in the supported platforms list (we're usually not an interesting consumer group).

I looked what's out there on amazon.de, there are decent ones for less than 20$.

That's it from discreet affiliate links from me, onto solving the problem:

I plugged in the card reader, installed eid middleware like instructed, it didn't work. No wonder, missing drivers:

$ sudo apt update
$ sudo apt install opensc-pkcs11 libpam-pkcs11 pcscd

Then I was able to activate the card.

Smart card reader stopped working

I updated my distro version to Ubuntu 22.04, and then the card reader no longer worked.

Reason is that pcscd service is not enabled to start on boot by default.

Just double check if it's running, you should get something like this:

sudo systemctl enable pcscd
sudo systemctl start pcscd
sudo systemctl status pcscd
● pcscd.service - PC/SC Smart Card Daemon
     Loaded: loaded (/usr/lib/systemd/system/pcscd.service; indirect; vendor pr>
     Active: active (running) since Mon 2022-10-31 07:42:45 CET; 8h ago
TriggeredBy: ● pcscd.socket
       Docs: man:pcscd(8)
   Main PID: 3706 (pcscd)
      Tasks: 8 (limit: 77026)
     Memory: 2.6M
        CPU: 1.612s
     CGroup: /system.slice/pcscd.service
             └─3706 /usr/sbin/pcscd --foreground --auto-exit

Oct 31 07:42:45 Racunalo systemd[1]: Started PC/SC Smart Card Daemon.

And after enabling the reader

Next stop was activating my mobile id, for that I had to load PKCS 11 module in my browser.

Instructions are posted below, and take a look at #Hint 2: Default Firefox installation is broken, I couldn't load the .so module! if you'll have issues with Firefox.

Upute-za-koristenje-Certilia-Middleware-u-Firefox-preglednikuDownload

Hint 1: Chrome's not supported, only Firefox provides a mechanism to specify a PKCS#11 provider.

Unless something's changed since this years old discussion, I tried digging in the options but couldn't find it.

Hint 2: Default Firefox installation is broken, I couldn't load the .so module!

All discussion is better explained at https://askubuntu.com/questions/1409351/ubuntu-22-04-firefox-unable-to-load-module, so I'll only recommend you:

  • uninstall the default one that you get with Ubuntu installation
  • install a new Firefox from mozilla builds
  • try loading the so file again. Options -> Privacy and Security -> Security Devices (Scroll to bottom) -> click on load and find your pkcs provider.

Easy! As I said!

Update 2024. I had to refresh my certilia certificate, in my case pkcs11 modules were in /lib/akd/eidmiddleware. Everything else is the same.