Omnikey CardMan 4040

The Omnikey CardMan 4040 is a PCMCIA smartcard reader that can be used for OpenPGP smartcards. This article aims to provide a setup for using it with GnuPG via PC/SC.

Kernel Setup
The Card reader obviously needs PCMCIA support, so activate the following options and choose the bridge that is in your computer.

Now activate the kernel module for your card reader:

Compile and install the new kernel with those options. After reboot check that when the card is inserted you have the device /dev/cmx0 or similar for your card reader.

Install pcsc-lite
Enable the following use flags:  and update your system:

Now download the PC/SC drivers from http://www.hidglobal.com/driverDownloads.php?techCat=19&prod_id=180. There is a version for Linux and Linux x64. Choose the right for your computer and extract the library ifdok_cm4040_lnx_x64-2.0.0.so to /usr/lib/pcsc/drivers/. The filename may differ depending if you choose x64 or not. Now create /etc/readers.conf/cardman4040.conf and put the following content:

You might need to adapt LIBPATH and DEVICENAME to your needs.

The last step is to edit /lib/udev/rules.d/99-pcscd-hotplug.rules add the following lines above the ACTION= line:

Now after a restart of udev or a reboot the card reader should work. Try with

If everything works fine you can add your normal user to the pcscd group:

Now John should be able to access the card as above

Conclusion
You are now ready to use your card reader. You coul for example read the following guides:

http://www.gnupg.org/howtos/card-howto/en/smartcard-howto.html or

http://wiki.fsfe.org/Card_howtos/Card_with_subkeys_using_backups

It is not quite satisfactory that we had to use the closed source library. Maybe this device also works with the OpenCT library (see http://www.opensc-project.org/openct).

For the above reason and some occasional unstabilities (maybe related to this: https://bugs.g10code.com/gnupg/msg3107) I now use Gemalto PC Card.