Drivers, tools, and libraries for Unix. |
Most of these tools do not have to be built from source on current Linux distributions. |
OpenCT provides drivers for smart card readers and makes them available via the CT-API or as a PC/SC-Lite ifdhandler. You don't really need this to use the eToken on Linux and build instructions are included here just for completeness.
pkg-config --libs libpcsclite
works.LIBUSB_CFLAGS=`libusb-config --cflags` LIBUSB_LIBS=`libusb-config --libs` PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local/depot/openct-0.6.14 --with-bundle-dir=/usr/local/pcsc/drivers
OpenCT has been configured with the following options Version: 0.6.9 Host: i686-pc-linux-gnu PC/SC support: yes Without libusb coldplugging will not work. |
make
make install
/usr/local/pcsc/drivers/openct-ifd.bundle/Contents/Info.plist
OpenSC provides an API to access smart cards. It can deal with both PCSC and OpenCT readers as well as PKCS#11 providers. For use with the eToken, pkcs11-tool
and cardos-info
are quite useful. OpenSC is also required for building other useful components of the OpenSC project.
OpenSC formatted cards use PKCS#15 and are widely supported on Unix. An eToken formatted with the FIPS option will not allow you to create the PKCS#15 application.
libassuan
.pkg-config --libs libpcsclite openssl libopenct
works.PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local/depot/opensc-0.11.4 --mandir=/usr/local/depot/opensc-0.11.4/man
|
opensc.conf
in /usr/local/depot/opensc-0.11.1/etc
. Should probably be /usr/local/etc
make
make install
opensc.conf
if those readers generate error messages.
# Be sure you can see the reader # Read the token's ATR # List files 3f006666 [AKS] type: DF, size: 3896 3f0066661000 type: DF, size: 3896 3f00666610000001 type: wEF, ef structure: transpnt, size: 11 |
$ cardos-info -v |
$ pkcs11-tool --module /usr/local/lib/libetpkcs11.so --list-slots $ pkcs11-tool --module /usr/local/lib/libetpkcs11.so --show-info $ pkcs11-tool --module /usr/local/lib/libetpkcs11.so --list-objects $ pkcs11-tool --module /usr/local/lib/libetpkcs11.so --list-objects --login # Copy certificate off of token # Usage of PKCS11-spy *************** OpenSC PKCS#11 spy ***************** 0: C_GetFunctionList 1: C_Initialize 2: C_GetSlotList 3: C_GetSlotList 4: C_GetSlotInfo 5: C_GetTokenInfo 6: C_Finalize |
$ cardos-info # VT token that can't have PKCS15 added Info : CardOS/M4.0 (C) Siemens AG 1994-1999 (Feb 15 2000) Chip type: 20 Serial number: 13 bb 97 0c 19 0e Full prom dump: 33 FF EB 31 FF FF FF FF 14 65 13 BB 97 0C 19 0E 3..1.....e...... 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ OS Version: 200.2 (that's CardOS M4.0) Current life cycle: 16 (operational) Security Status of current DF: Free memory : 64 ATR Status: 0x0 ROM-ATR Packages installed: 01 04 0C 02 C8 02 01 04 01 01 C8 02 01 04 08 02 ................ C8 02 01 04 03 01 C8 02 01 04 0B 01 C8 02 01 04 ................ 11 02 C8 02 .... Ram size: 1024, Eeprom size: 16384, cpu type: 66, chip config: 61 Free eeprom memory: 3896 System keys: PackageLoadKey (version 0x01, retries 10) System keys: StartKey (version 0x01, retries 10) Path to current DF: 66 66 10 00 ff.. # Token formated without FIPS. Works with pkcs15-init $ cardos-info Info : CardOS/M4.01 (C) Siemens AG 1994-2001 Chip type: 96 Serial number: 26 13 bd 17 10 23 Full prom dump: 33 66 00 45 FF FF FF FF 60 FF 26 13 BD 17 10 23 3f.E....`.&....# 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ OS Version: 200.3 (that's CardOS M4.01) Current life cycle: 32 (administration) Security Status of current DF: Free memory : 64 ATR Status: 0x0 ROM-ATR Packages installed: Ram size: 2, Eeprom size: 32, cpu type: 66, chip config: 63 Free eeprom memory: 18909 System keys: PackageLoadKey (version 0x00, retries 10) System keys: StartKey (version 0xff, retries 10) Path to current DF: 66 66 10 00 ff.. |
pkcs15-init --pin 3333 --create-pkcs15 --profile pkcs15+onepin $ pkcs15-tool --dump PIN User PIN $ pkcs15-init --generate-key "rsa/1024" --auth-id 01 --pin 3333 $ pkcs15-tool --dump PIN User PIN Private RSA Key Private Key Public RSA Key Public Key $ pkcs15-init --store-private-key thawte-vt-20060914.p12 --format PKCS12 --auth-id 01 --key-usage sign |
Libp11 is a library implementing a small layer on top of PKCS#11 API to make using PKCS#11 implementations easier. It is required by Engine_PKCS#11 and pkcs11-helper.
./configure --prefix=/usr/local/depot/libp11-0.2.3
make
make install
Engine_pkcs11 is an implementation of an engine for OpenSSL. It allows a PKCS#11 provider to be used make a smartcard usable from OpenSSL.
pkg-config --libs libp11
works.PKG_CONFIG_PATH=/usr/local/lib/pkgconfig ./configure --prefix=/usr/local/depot/engine_pkcs11-0.1.4
Engine_pkcs11 has been configured with the following options OpenSSL support: yes |
make
make install
Pkcs11-helper is a library that simplifies the interaction with PKCS#11 providers for end-user applications using a simple API. It is required to use eTokens with gnupg-pkcs11-scd
and ssh
. It is one of the most important tools for using the eToken with unix applications.
./configure --prefix=/usr/local/depot/pkcs11-helper-1.03 --enable-docs --with-test-provider=/usr/local/lib/libetpkcs11.so
./configure --prefix=/usr/local/depot/pkcs11-helper-1.03 --enable-docs --with-test-provider=/usr/local/lib/libetpkcs11.so --with-test-log-level=5
./configure --prefix=/usr/local/depot/pkcs11-helper-1.05 --enable-docs --with-test-provider=/usr/lib/libeTPkcs11.so --with-test-log-level=5
# With 4.55 RTE, tests pass Making check in tests make[1]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests' Making check in test-basic make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-basic' make check-TESTS make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-basic' Version: 00010500 Features: 000003f9 Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/lib/libeTPkcs11.so' Terminating pkcs11-helper PASS: test-basic ================== All 1 tests passed ================== make[3]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-basic' make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-basic' Making check in test-certificate make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-certificate' make check-TESTS make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-certificate' Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/lib/libeTPkcs11.so' Please remove all tokens, press <Enter>: Enumerating token certificate (list should be empty, no prompt) Please insert token, press <Enter>: Getting certificate cache, should be available certificates Issuer: /C=US/ST=Virginia/L=Blacksburg/O=Virginia Tech Root CA on Phil-Prod Issuer: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Virginia Tech User CA on Phil-Prod Certificate: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Phillip E Benchoff/UID=817397/serialNumber=379 on Phil-Prod Please remove token, press <Enter>: Getting certificate cache, should be similar to last Issuer: /C=US/ST=Virginia/L=Blacksburg/O=Virginia Tech Root CA on Phil-Prod Issuer: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Virginia Tech User CA on Phil-Prod Certificate: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Phillip E Benchoff/UID=817397/serialNumber=379 on Phil-Prod Creating certificate context Perforing signature #1 (you should be prompt for token and PIN) Please insert token 'Phil-Prod' 'ok' or 'cancel': ok Please enter 'Phil-Prod' PIN or 'cancel': Perforing signature #2 (you should NOT be prompt for anything) Please remove and insert token, press <Enter>: Perforing signature #3 (you should be prompt only for PIN) Please enter 'Phil-Prod' PIN or 'cancel': Perforing signature #4 (you should NOT be prompt for anything) Terminating pkcs11-helper PASS: test-certificate ================== All 1 tests passed ================== make[3]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-certificate' make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-certificate' Making check in test-slotevent make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-slotevent' make check-TESTS make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-slotevent' Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/lib/libeTPkcs11.so' as auto slotevent Please remove and insert tokens (pause for 30 seconds) slotevent slotevent Adding provider '/usr/lib/libeTPkcs11.so' as trigger Please remove and insert tokens (pause for 30 seconds) slotevent slotevent Adding provider '/usr/lib/libeTPkcs11.so' as poll Please remove and insert tokens (pause for 30 seconds) slotevent Adding provider '/usr/lib/libeTPkcs11.so' as fetch Please remove and insert tokens (pause for 30 seconds) slotevent slotevent slotevent Terminating pkcs11-helper Terminating pkcs11-helper PASS: test-slotevent ================== All 1 tests passed ================== make[3]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-slotevent' make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests/test-slotevent' make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests' make[2]: Nothing to be done for `check-am'. make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests' make[1]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05/tests' make[1]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05' make[1]: Nothing to be done for `check-am'. make[1]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.05' analon:/usr/local/src/Aladdin/pkcs11-helper-1.05 (2) $ |
> make check make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-basic' Version: 00010000 Features: 000001fd Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/local/lib/libetpkcs11.so' Terminating pkcs11-helper PASS: test-basic ================== All 1 tests passed ================== make[3]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-basic' make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-basic' Making check in test-certificate make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-certificate' make check-TESTS make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-certificate' Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/local/lib/libetpkcs11.so' Please remove all tokens, press <Enter>: Enumerating token certificate (list should be empty, no prompt) Please insert token, press <Enter>: Getting certificate cache, should be available certificates Certificate: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Phillip E Benchoff/UID=817397/serialNumber=379 on Phil-Prod Please remove token, press <Enter>: Getting certificate cache, should be similar to last Certificate: /DC=edu/DC=vt/C=US/O=Virginia Polytechnic Institute and State University/CN=Phillip E Benchoff/UID=817397/serialNumber=379 on Phil-Prod Creating certificate context Perforing signature #1 (you should be prompt for token and PIN) Please insert token 'Phil-Prod' 'ok' or 'cancel': ok Please enter 'Phil-Prod' PIN or 'cancel': Perforing signature #2 (you should NOT be prompt for anything) Please remove and insert token, press <Enter>: Perforing signature #3 (you should be prompt only for PIN) Perforing signature #4 (you should NOT be prompt for anything) Terminating pkcs11-helper PASS: test-certificate ================== All 1 tests passed ================== make[3]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-certificate' make[2]: Leaving directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-certificate' Making check in test-slotevent make[2]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-slotevent' if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -g -O2 -Wall -Wpointer-arith -Wsign-compare -Wno-unused-parameter -Wno-unused-function -MT test-slotevent.o -MD -MP -MF ".deps/test-slotevent.Tpo" -c -o test-slotevent.o test-slotevent.c; \ then mv -f ".deps/test-slotevent.Tpo" ".deps/test-slotevent.Po"; else rm -f ".deps/test-slotevent.Tpo"; exit 1; fi /bin/sh ../../libtool --tag=CC --mode=link gcc -g -O2 -Wall -Wpointer-arith -Wsign-compare -Wno-unused-parameter -Wno-unused-function -o test-slotevent test-slotevent.o ../../lib/libpkcs11-helper.la -lpthread -ldl -lssl -lcrypto -ldl mkdir .libs gcc -g -O2 -Wall -Wpointer-arith -Wsign-compare -Wno-unused-parameter -Wno-unused-function -o .libs/test-slotevent test-slotevent.o ../../lib/.libs/libpkcs11-helper.so -lpthread -lssl -lcrypto -ldl -Wl,--rpath -Wl,/usr/local/depot/pkcs11-helper-1.02/lib creating test-slotevent make check-TESTS make[3]: Entering directory `/usr2/local/src/Aladdin/pkcs11-helper-1.02/tests/test-slotevent' Initializing pkcs11-helper Registering pkcs11-helper hooks Adding provider '/usr/local/lib/libetpkcs11.so' as trigger slotevent Please remove and insert tokens (pause for 30 seconds) slotevent slotevent # This test hangs here. |
pkcs11h_removeProvider (TEST_PROVIDER))
after the trigger test never returns.--disable-threads --disable-slotevent
.--with-test-log-level=5
enables max debugging from tests../configure --prefix=/usr/local/depot/pkcs11-helper-1.03 --enable-docs --with-test-provider=/usr/local/lib/pkcs11-spy.so --with-test-log-level=5
PKCS11SPY=/usr/local/lib/libetpkcs11.so ./test-slotevent
# Removed -pre PIN:1111 since the user will be prompted. # Verify that the engine is available # Show engine capabilities OpenSSL> req -engine pkcs11 -new -key 39453945373335312d333545442d343031612d384637302d3238463636393036363042303a30 -keyform engine -text -x509 -subj "/CN=Phil" X509v3 Basic Constraints: # The second attempt fails ################################################## # Just testing req -engine pkcs11 -new -key id_39453945373335312d333545442d343031612d384637302d3238463636393036363042303a30 -keyform engine -text -x509 -subj "/CN=Phil" req -engine pkcs11 -new -key 39453945373335312d333545442d343031612d384637302d3238463636393036363042303a30 -keyform engine -text -x509 -subj "/CN=Phil" OpenSSL> x509 -engine pkcs11 -noout -text |
$ openssl |
pkg-config --libs libpcsclite
works../configure --prefix=/usr/local/depot/globalplatform-3.0.2
make
http://sourceforge.net/projects/globalplatform/
pkg-config --libs libpcsclite
works../configure --prefix=/usr/local/depot/gpshell-1.3.1
make