Pkcs11-tool not showing token in slot / Nitrokey Start on Ubuntu 16.04

Opensc tool sees my card (and so does gpg --card-status) :

    $ opensc-tool -l
    # Detected readers (pcsc)
    Nr.  Card  Features  Name
    0    Yes             Nitrokey Nitrokey Start (FSIJ-1.2.6-67111443) 00 00

However, I have a problem with pkcs11-too

     $ pkcs11-tool -L
     Available slots:
     Slot 0 (0xffffffffffffffff): Virtual hotplug slot
       (empty)
     Slot 1 (0x1): Nitrokey Nitrokey Start (FSIJ-1.2.6-67111443) 00 00
      (empty)

Is there a way to troubleshoot this with Nitrokey start ? I would like to use the OpenSC java PKCS11 provider.

Hi!

There is a conflict in access to the device between the OpenSC and GnuPG. Most probably, if you remove the device from the USB slot, and insert again, the OpenSC commands would work, but not the GnuPG. The actual behavior depends on the Linux distribution.

Please look at:

I tried a couple of things to shut down gpg, but no success so far. pcscd is required to detect the card insertion, but after inserting the dongle, I get more error messages trying to troubleshoot the situation :

 $ opensc-explorer
OpenSC Explorer version 0.15.0
Using reader with a card: Nitrokey Nitrokey Start (FSIJ-1.2.6-67111443) 00 00
unable to select MF: Unknown data received from card

On my Fedora 29 the pkcs11-tool -L works right after the Nitrokey Start insertion. What is your distribution?

BTW you seem to have very old OpenSC version - 0.15 - maybe this is the cause. Current one is 0.19 (that’s the one I use), and 0.20 is planned to be released soon.

cc: @nitroalex

Currently running Ubuntu 16.04, I will look into upgrading.

Indeed using such an old OpenSC version can be the reason. In some versions the Nitrokey Start is not detected correctly at all. Please try the versions found in our repo here.

I did my own build of opensc off github and I’m happy to report that the problem is entirely resolved.