# what packages should I install to make my debian machine support smartcards?
# you should at least install the following packages:
| package | description | comments |
| pcscd | middleware to access a smartcard using pcsc | mandatory |
| libccid | pcsc driver for usb ccid smartcard readers | recommended: many/most modern smartcard readers are ccid-compliant |
| libpcsclite1 | middleware to access a smartcard using pcsc | mandatory |
| libusb | user space usb programming library | mandatory |
# I execute the following commands to activate support for my usb smartcard reader (
GemPC Twin,
GemPC Key)
sudo apt-get install libccid libusb-0.1-4 pcscd libpcsclite1
# sudo shutdown -r now # rebooting your machine is a safe way to make the bloody thing work, feel free to ignore rebooting :)
# You can now test whether it works if you observe
/var/log/messages.
If you connect your smartcard reader and insert a smartcard, you should see (at least) the discovery of the reader, and the ATR of the card you inserted (after connecting the reader to the computer):
sudo tail -f /var/log/messages &
# how can I install a towitoko chipdrive micro smartcard reader?
- # you should install the
libtowitoko2 package (in addition to the packages specified earlier to enable smartcard support) (rebooting is not necessary as usb devices do less easily tend to make your machine hang
):
sudo apt-get install libtowitoko2 pcscd libpcsclite1
- # if you connected your reader to the first serial port (/dev/ttyS0, aka COM1), you shall finetune the configuration file for serial readers:
cat > /etc/reader.conf.d/libtowitoko2 << EOF
FRIENDLYNAME "Towitoko Chipdrive Reader, first serial port"
DEVICENAME /dev/ttyS0
LIBPATH /usr/lib/libtowitoko.so.2.0.0
CHANNELID 0x0103F8
EOF
- # in case you connected another towitoko reader to the second serial port, you should extend this file configuration file:
cat >> /etc/reader.conf.d/libtowitoko2 << EOF
FRIENDLYNAME "Towitoko Chipdrive Reader, second serial port"
DEVICENAME /dev/ttyS1
LIBPATH /usr/lib/libtowitoko.so.2.0.0
CHANNELID 0x0102F8
EOF
- # once you created the basic configuration file, you should update the actual reader configuration file, and restart the pcsc daemon:
update-reader.conf
/etc/init.d/pcscd stop
/etc/init.d/pcscd start
- # check whether the reader(s) get(s) detected and whether you can see the ATR of the smartcard(s) you insert in your reader(s):
sudo tail -f /var/log/messages &
# what should I do to configure a gempc card on my debian machine?
# If your
GemPC? Card is connected to
/dev/ttyS1 you should create a file
/etc/reader.conf.d/gempccard1 use the following configuration file:
FRIENDLYNAME "GemPC Card"
DEVICENAME /dev/ttyS1
LIBPATH /usr/lib/pcsc/drivers/serial/libccidtwin.so.0.9.2
CHANNELID 1
# If your
GemPC? Card were connected to
/dev/ttyS0 the file
/etc/reader.conf.d/gempccard1 should look like:
FRIENDLYNAME "GemPC Card"
DEVICENAME /dev/ttyS0
LIBPATH /usr/lib/pcsc/drivers/serial/libccidtwin.so.0.9.2
CHANNELID 0
# Once you have created these files, you have to update the smartcard readers' configuration file:
sudo update-reader.conf
# Subsequently, you should restart the pcsc daemon:
sudo /etc/init.d/pcscd restart
# It may happen from time to time, e.g., when re-inserting a smartcard, that the gempc card gets confused... You can solve this problem as follows:
sudo killall -9 pcscd
sudo rm -rf /var/run/pcscd.*
sudo /etc/init.d/pcmcia restart
sudo /etc/init.d/pcscd restart
# what should I do to use an ASC ACR38 smartcard reader on my debian machine?
- # download the pcsc driver from the ASC website and store it in a directory:
DRIVERDIR=~/tmp/acs
mkdir -p $DRIVERDIR
cd $DRIVERDIR
- # install the package necessary to compile the driver:
sudo apt-get install libpcsclite-dev
- # unpack the files and patch whatever is necessary to make it compile properly:
tar -xzvf ACR38_LINUX_*_P.tar.gz
cd ACR38_LINUX_*_P
sudo ln -s /usr/lib/pcsc /usr/local/pcsc
perl -pi -e 's/-I./-I.\ -I\/usr\/include\/PCSC/' Makefile
make
sudo make install
- # if everything went fine, you should restart the pcsc daemon:
sudo /etc/init.d/pcscd restart