OpenCT

CTAPI is a german standard for PC to smartcard reader communication, which is implemented by OpenCT. The international standard is in contrast PC/SC.

Kernel
You have to enable kernel support depending on how your cardreader is connected:
 * For USB cardreader see the USB article.
 * For PC-Card cardreader see the PC-Card article.
 * For serial cardreader enable serial support.

Software
Portage knows the local USE flag openct for enabling support for OpenCT in other packages. Enabling this USE flag will pull in automatically:

The USE flags of openct are:

After setting this you want to update your system so the changes take effect:

Configuration
USB cardreader are detected automatically und work out of the box. For PC-Card and serial cardreader you have to adjust your. See the man page for more informations:

Permissions
Add your user to the openct group to be able to access the cardreader:

Service
You can now start OpenCT:

To start OpenCT at boot time, add it your default runlevel:

Testing
List all detected cardreaders:

If there is a detected cardreader, insert a smartcard. Test the access by checking the ATR:

ifdhandler
If you installed OpenCT with pcsc-lite USE flag, a pseudo ifd driver is installed, so that PCSC-Lite kann use the OpenCT drivers. Additionally you have to do some extra steps, so that PCSC-Lite recognizes the idf driver: {{RootCmd }}
 * mkdir -p /usr/lib/readers/usb/ifd-openct.bundle/Contents/Linux
 * ebuild /usr/portage/dev-libs/openct/openct-0.6.20.ebuild unpack
 * cp /var/tmp/portage/dev-libs/openct-0.6.20/work/openct-0.6.20/etc/Info.plist /usr/lib/readers/usb/ifd-openct.bundle/Contents
 * ln -s /usr/lib/openct-ifd.so /usr/lib/readers/usb/ifd-openct.bundle/Contents/Linux/
 * cp /var/tmp/portage/dev-libs/openct-0.6.20/work/openct-0.6.20/etc/reader.conf.in /etc/readers.conf.d/openct.conf
 * sed -i -e "s/@libdir@/}/\/usr\/lib/" /etc/reader.conf.d/openct.conf
 * update-reader.conf