Installation of Smart Card Software
Damien Sauveron
LaBRI
Distributed Objects and Systems Team
351 Cours de la Liberation 33405 TALENCE Cedex FRANCE
SERMA Technologies
Information Technology Security Evaluation Facilities Center
30 avenue Gustave Eiffel 33608 PESSAC Cedex FRANCE
Revision History | ||
---|---|---|
Revision 1.1 | 04/01/2004 | DS |
Improve the presentation of the document. | ||
Revision 1.0 | 03/10/2003 | DS |
First version. |
Abstract
The installation and the usage of some Smart Card software is a complex job. This document could help you to set up an environment in order to take a good way for the Smart Card's world.
Table of Contents
-
Introduction
Greetings
PC/SC Lite and drivers
- Install of libusb Installation of the JDKs
- Installation of the Java Card Development Kits
- Installation of the GemXpresso RAD III kit Installation of the OpenCard Framework Installation of the OCF to PC/SC bridge Installation of JPCSC 0.7.2 Installation of the JCOP 2.1 kit Installation of the OpenSC Installation of the Muscle Framework
- FAQ References
Introduction
I have written this document in order to share my experience on usage of Smart Card on a Linux environment (Slackware 8.1™). I hope this will help you to cope with the installation and using problems. This document describes the installation of:
-
PC/SC Lite and some drivers;
-
many Java Development Kits and Java Card Development Kits;
-
OpenCard Framework (OCF), OCF to PC/SC bridge, GemXpresso RAD3;
-
JPCSC library and JCOP Tools.
Note
For many operations you must have the root privileges on the host.
Greetings
Thanks for all the volunteers who work on the development of PC/SC Lite, free drivers, Muscle, etc. I don't forget all the people who answer on Muscle and other mailing list, newgroups, etc.
PC/SC Lite and drivers
Install of PC/SC Lite
Download the last version of PC/SC Lite [PCSCLite].
user% tar xvzf pcsc-lite-x.y.z .tar.gz |
If you want use USB readers you must use the --enable_libusb . Libusb is a portable API available on many OS for usage of USB. If libusb is not installed on your system, install it.
user% ./configure --enable-libusb=/usr/local --enable-daemon --enable-debug --enable-threadsafe --prefix=/usr/local/pcsc --sysconfdir=/etc --enable-runpid=/var/run/pcscd.pid |
Note
/usr/local is my path for my libusb install.
Note
The --enable_threadsafe implies to compile the clients of the PC/SC middleware with -lpthread for using the pthread library.
Compile PC/SC Lite.
user% make |
Get the root privileges and install it.
root% make install |
Note
For security reasons we should create a special account with the good privileges to start the daemon.
You can test:
-
PC/SC Lite installation and the SCard API with the tool testpcsc in src/
-
MuscleCard Framework API with the tool muscletest in src/
Install of SERIAL readers
Your kernel or one of its module must manage the serial port.
Get the root privileges.
root% cd /dev/pcsc |
Gemplus GCR410
Download the last version of ifd-gempc-x.y.z .tar.gz [RousseauWeb].
root% tar xvzf ifd-gempc-x.y.z .tar.gz |
INCS = -I/usr/local/pcsc/include |
root% make |
FRIENDLYNAME "Gemplus GemPC410 Reader" |
SmartMouse SM1 RS232
Download ifd-sm-x.y.z .tar.gz [SauveronWeb]
root% tar xvzf ifd-sm-x.y.z .tar.gz |
FRIENDLYNAME "SM1 Reader" |
TOWITOKO CHIPDRIVE extern 320
Download towitoko-x.y.z .tar.gz
user% tar xzvf towitokox.y.z .tar.gz |
root% make install |
FRIENDLYNAME "TOWITOKO CHIPDRIVE extern 320" |
Install of USB readers
Your kernel or one of its module must handle the USB. For me:
root% modprobe usbcore |
Generic CCID readers
Download ccid-x.y.z .tar.gz [PCSCLite]. This driver needs libusb (cf. the libusb section).
user% tar xvzf ccid-x.y.z .tar.gz |
root% make install |
SCM Microsystems SCR 331
Plug your reader and get the informations with lsusb -v or cat /proc/bus/usb/devices If you obtain for the SCR331 an idProduct's value equal to 0xe000, you must upgrade the firmware explained in the following procedure. Else if you obtain 0xe001 you must choose to use the generic CCID driver (cf. section Generic CCID readers) or install the SCM driver as described at the end of this section.
Procedure 1. Upgrade the firmware
The firmware in the USB reader can be updated to the latest version, which should work with the GNU/Linux driver on SCM's web site:
-
Find a windows machine (an unfortunate necessity)
-
Download and install the SCRx31_USB_1.40_signed.zip windows driver from http://www.scmmicro.com/security/secureCard-downloads.html (Click on the SCR331 PCSC link.) Personally I use SCR331 Installer V2.05.zip .
-
Download the USB-FWUpdate.zip program.
-
Download the new firmware (SCRx31_Firmware_4.13.zip ).
-
Run the USB-FWUpdate program and select the .bin file from the firmware package.
-
Now the USB reader should be upgraded to the CCID version.
-
Throw your windows system away and plug the reader into your GNU/Linux box. Now lsusb -v or cat /proc/bus/usb/devices shall give an idProduct set up at 0xe001.
Install the GNU/Linux driver from ftp://ftp.scmmicro.com/security/drivers/scr331ccidDriver-0.9.0-1.i386.rpm On my Slackware, I converted the rpm to a tgz file using rpm2tgz
tar xvzf scr331ccidDriver-0.9.0-1.i386.tgz |
TOWITOKO CHIPDRIVE extern 330
Download towitoko-x.y.z .tar.gz
user% tar xzvf towitokox.y.z .tar.gz |
root% make install |
OMNIKEY CardMan 2020
user% tar xzvf cm2020_installer_vX_Y_Z _src.tar.gz |
root% sh install |
Install of PCMCIA readers
Gemplus GPR400
1) Installation of the module for the pcmcia card GRP400: This is necessary to handle the PCMCIA. Download the sources of the pcmcia-cs [PCMCIA-CS]
user% tar xvzf pcmcia-cs-3.1.34.tar.gz |
user% cd pcmcia-cs-3.1.34 |
user% make config |
root% make install |
root% cd /dev/pcsc |
/* |
FRIENDLYNAME "Gemplus GPR400 Reader" |
Note
I have submitted a modified version of this driver to Joe Phillips.
SCM SCR241
TO DO!
Install of libusb
Download libusb-0.1.7.tar.gz [LibUSB].
user% tar xvzf libusb-0.1.7.tar.gz |
root% make install |
Installation of the JDKs
Download the JDKs.
Note
Do some scripts to set up the environment.
SUN JDK 1.2.2
Get the root privileges.
root% cd /usr/local |
SUN JDK 1.3.1
Get the root privileges.
root% cd /usr/local |
IBM JDK 1.3.1
Get the root privileges.
root% cd /usr/local |
Installation of fonts
For the SUN JDK 1.2.2 and the SUN JDK 1.3.1 Download symbol.ttf Get the root privileges.
root% cp symbol.ttf $JAVA_HOME/jre/lib/fonts/ |
Installation of the communication APIs
Get on the Gemplus CD of GemXPresso RADIII the linux_commapi_conf.tar
user% tar xvf linux_commapi_conf.tar |
root% cp comm.jar $JAVA_HOME/jre/lib/ext/ |
root% cp libSerial.so $JAVA_HOME/jre/lib/i386/ |
root% cp libSerial.so $JAVA_HOME/jre/lib/ext/ |
Note
For using the serial port the user must have the rights rw on it. As root do root% chmod 666 /dev/ttyS?
Installation of the Java Card Development Kits
Download the JCDKs. Get the root privileges.
root% cd /usr/local |
Note
Do some scripts to set up the environment.
JCDK 2.1.1
root% tar xvzf java_card_kit-2_1_1-unix[1].tar.Z |
JCDK 2.1.2
root% unzip java_card_kit-2_1_2-solsparc.zip |
JCDK 2.2
root% unzip java_card_kit-2_2-solsparc-gl.zip |
Installation of the GemXpresso RAD III kit
The install does not work with the JDK 1.2.2 Get the root privileges mount the 'cdrom' with the GemXPresso RAD III CD. cd 'cdrom'/Unix I have chosen to install the different components in /opt/gemxpresso.rad3/ To install the RAD III:
root% ./RAD3_INS.bin |
root% ./CP_V1.bin |
root% ./FPK_SP.bin |
root% ./OCF_INS.bin |
-
if you wish using the communication APIs installed by yourself do
user% export RAD_HOME=/opt/gemxpresso.rad3
-
if you choose to use the APIs installed by the kit do
user% source /etc/gxp_rad_profile
Note
For using PC/SC with the OCF to PCSC bridge, it is not necessary to have the rights on the device because the pcscd daemon runs with the rights allowing the access.
Installation of the OpenCard Framework
The installOCF.class provided by [OCF] does not work on my Linux. Get the root privileges.
root% /usr/local/ |
Installation of the OCF to PC/SC bridge
Download OCFPCSC1-0.0.1.tar.gz [MUSCLE]. Contrary to this is written in the documentation it is possible to have more than one reader in the /etc/readers.conf
user% tar xvzf OCFPCSC1-0.0.1.tar.gz |
JDK_HOME = /usr/local/jdk1.2.2 |
user% make |
root% make install |
OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory |
OpenCard.terminals = com.ibm.opencard.terminal.pcsc10.Pcsc10CardTerminalFactory |
# I set OCF_LIB |
# ======================== OCF ============================= |
Installation of JPCSC 0.7.2
user% unzip jpcsc-72.zip |
root% make install |
root% echo "/usr/local/pcsc/lib" >> /etc/ld.so.conf |
Installation of the JCOP 2.1 kit
Get the root privileges.
root% cd /opt tar xvzf jctools-2.1-linux.tgz |
Installation of the OpenSC
Download opensc-x.y.z .tar.gz [OpenSC].
user% tar xvzf opensc-x.y.z .tar.gz |
Installation of the Muscle Framework
TO DO!
Muscle Applications
TO DO!
muscleTools
Download the last version of muscleTools.
user% tar xvzf muscleTools-x.y.z .tar.gz |
CFLAGS = -g -Wall -I/usr/local/pcsc/include |
user% make |
root% make install |
XCardII
Download the last version of XCardII.
user% tar xvzf XCardII-x.y.z .tar.gz |
user% make |
root% make install |
Muscle Plugins
The plugin are used by the muscle framework to manage the different cards. For example the MCardPlugin is used to handle a Java Card using the MCardApplet and the CFlexPlugin is used for the Cryptoflex card.
MCardPlugin
Download the last version of MCardPlugin.
user% export CPPFLAGS=-I/usr/local/pcsc/include |
root% ./installBundle |
Note
root% make install is useless.
FAQ
-
1.
What are the informations needed to obtain a quick and efficient response for a post on the mailing list?
2.
Why does pcsc-lite fail to communicate with the serial port?
1. | What are the informations needed to obtain a quick and efficient response for a post on the mailing list? |
Join the informations about your hardware and software system:
| |
2. | Why does pcsc-lite fail to communicate with the serial port? |
Be sure that /dev/pcsc/1 is a link to /dev/ttyS0 and not to /dev/ttys0 . |
References
[PCSCLite] PC/SC Lite . http://alioth.debian.org/projects/pcsclite/.
[MUSCLE] MUSCLE . http://www.linuxnet.com/.
[SauveronWeb] Driver for SM1 . http://damien.sauveron.free.fr/.
[RousseauWeb] GemCore based PC/SC reader drivers . http://ludovic.rousseau.free.fr/softwares/ifd-GemPC/.
[JPC/SC] The JPC/SC specifications and driver . http://www.linuxnet.com/middleware/.
[OCF] OpenCard Framework . http://www.opencard.org/.
[PCSCSpec] PC/SC Specifications . http://www.pcscworkgroup.com/.
[CCIDSpec] Chip/Smart Card Interface Devices (CCID) . http://www.usb.org/developers/.
[LibUSB] The libusb project home . http://libusb.sourceforge.net/.
[PCMCIA-CS] Linux PCMCIA Information Page . http://pcmcia-cs.sourceforge.net/.
[JavaCardSpec] Java Card™ 2.2 Specifications . Sun microsystems. http://java.sun.com/products/javacard/.
[OpenSC] OpenSC . http://www.opensc.org/.
[OpenCT] OpenCT . http://www.opensc.org/.