PCSC-Lite

From Gentoo Wiki
Jump to: navigation, search
Resources

PCSC-Lite implements the PC/SC international standard for PC to smartcard reader communication.

Installation

Kernel

The kernel configuration depends on how the card reader is connected:

  • For USB card reader see the USB article.
  • For PC-Card card reader see the PC-Card article.
  • For serial card reader enable serial support.

USE flags

USE flags for sys-apps/pcsc-lite PC/SC Architecture smartcard middleware library

libusb Use dev-libs/libusb detection to hotplug new smartcard readers. This flag should only be enabled if you're running a non-Linux kernel or you don't want to use sys-fs/udev.
policykit Uses sys-auth/polkit to restrict access to smartcard readers or smartcars to given users.
python Add optional support/bindings for the Python language
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
systemd Enable use of systemd-specific libraries and features like socket activation or session tracking
udev Use sys-fs/udev rules to handle devices' permissions and hotplug support. Unless you know what you're doing do not disable this flag on Linux kernels. This is provided as an option for completeness.

PCSC-Lite support can be enabled system-wide by setting the pcsc-lite USE flag:

FILE /etc/portage/make.conf
USE="... pcsc-lite ..."

Emerge

Update the system so the changes can take effect:

root #emerge --ask --changed-use --deep @world

Install PCSC-Lite:

root #emerge --ask --noreplace sys-apps/pcsc-lite

Additional software

Install one or more of the following driver packages:

Configuration

USB card readers are detected automatically and work out of the box. For PC-Card and serial card readers, /etc/reader.conf.d/reader.conf will need to be adjusted. See man reader.conf for more information.

Service

OpenRC

To start PCSC-Lite:

root #rc-service pcscd start

To start PCSC-Lite at boot time, add it to the default runlevel:

root #rc-update add pcscd default
Note
The PCSC-Lite daemon blocks all detected card readers for every other software.

Testing

Start the daemon in debug mode manually:

root #/etc/init.d/pcscd stop
root #pcscd -a -d -f

The daemon will now output all detected card readers. If a card reader is not detected, the correct driver may not have been installed. If there is a detected card reader, insert a smartcard. The daemon should inform about this event and among other things output the ATR, e.g.:

CODE ATR
00000028 Card ATR: 3B 75 94 00 00 62 02 02 03 01

If everything works the daemon can be killed with Ctrl+C.

See also

  • OpenCT — a German standard for PC to smartcard reader communication, which is implemented by OpenCT.