Primary low-level tools for using the eToken on Linux.

This is a first attempt to revise the eToken on Unix documentation. The focus is getting the eToken to work for ssh authentication. Most of this was tested and developed on a Fedora 14 system using the packages that are part of the distribution.

eToken hardware

RSA Key Length

Aladdin versus OpenSC/PKCS#15

If you have a working Aladdin RTE on your computer, you probably want to use PCSC and create your authentication keys within the Aladdin application. If you do not, you probably want to use OpenSC to create a PKCS#15 application and use OpenCT for the reader.

Aladdin RTE setup

# Aladdin RTE and token inserted.  The reader will
$ opensc-tool --list-readers
Readers known about:
Nr.    Driver     Name
0      pcsc       AKS ifdh 00 00

OpenSC setup

# OpenCT reader should be seen.
$ opensc-tool --list-readers
Readers known about:
Nr.    Driver     Name
0      openct     OpenCT reader (detached)
1      openct     OpenCT reader (detached)

# Here's what you get with a token plugged in.
$ opensc-tool --list-readers
Readers known about:
Nr.    Driver     Name
0      openct     Aladdin eToken PRO 64k
1      openct     OpenCT reader (detached)

# OpenCT can see the token too
$ openct-tool list
  0 Aladdin eToken PRO 64k

# cardos-tool should be able to see your token
$ cardos-tool --info
Using reader with a card: Aladdin eToken PRO 64k
3b:f2:18:00:02:c1:0a:31:fe:58:c8:09:75
Info : CardOS V4.2B (C) Siemens AG 1994-2005
Chip type: 124
Serial number: 27 38 29 11 2f 1c
Full prom dump:
33 66 00 22 9A 9A 9A 9A 7C FF 27 38 29 11 2F 1C 3f."....|.'8)./.
00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................
OS Version: 200.9 (that's CardOS M4.2B)
Current life cycle: 32 (administration)
Security Status of current DF:
Free memory : 1024
ATR Status: 0x0 ROM-ATR
Packages installed:
Ram size: 4, Eeprom size: 64, cpu type: 66, chip config: 63
Free eeprom memory: 38913
System keys: PackageLoadKey (version 0xfe, retries 10)
System keys: StartKey (version 0xff, retries 10)
Path to current DF:

PKCS#15 initialization

Do not do this on a token issued by the VT CA and holding a certificate and keypair you need.

# Initialize and create the PKCS#15 application
$ pkcs15-init --erase --create-pkcs15 --no-so-pin --label green-pkcs15

# Create a user PIN
$ pkcs15-init --auth-id 01 --store-pin
# You will be prompted for both the PIN and PUK.

# Generate a key.
# You can also use the PKCS#11 driver to do this and you must use the PKCS#11 driver if
# you are storing your key in the Aladdin app.
$ pkcs15-init --generate-key rsa/1024 --auth-id 01  --id 20110907 --label "my-ssh-pkcs15"

# See the ssh key
pkcs15-tool --read-ssh-key 20110907

PKCS#11 driver

# Note: You will not see the token if it has not been initialized with a PKCS#15 application.
#       Until you do that, the slots will appear empty.
#
$ pkcs11-tool --module /usr/lib64/opensc-pkcs11.so --list-slots
Available slots:
Slot 0           Aladdin eToken PRO
  token label:   OpenSC Card (User PIN)
  token manuf:   OpenSC Project
  token model:   PKCS#15
  token flags:   login required, PIN initialized, token initialized
  serial num  :  10ACE7010816
Slot 1           (empty)
Slot 2           (empty)
Slot 3           (empty)

# Aladdin driver and PC/SC.  Token in slot:
$ pkcs11-tool --module /usr/lib/libeTPkcs11.so --list-slots
Available slots:
Slot 0           AKS ifdh 00 00
  token label:   Phil-Old-VT
  token manuf:   SafeNet Inc.
  token model:   eToken
  token flags:   login required, PIN initialized, token initialized, other flags=0x200
  serial num  :  429a630c
Slot 1           (empty)
Slot 2           (empty)
Slot 3           (empty)
Slot 4           (empty)
Slot 5           (empty)

# Key generation
$ pkcs11-tool --module /usr/lib/libeTPkcs11.so --keypairgen --key-type rsa:1024 --login --label "me@vt.edu" --id 20110831

# Aladdin app with VT CA certificate/keypair and added ssh key
$ pkcs11-tool --module /usr/lib/libeTPkcs11.so  --list-objects --login
Please enter User PIN:
Private Key Object; RSA
  label:
  ID:         60b867e6dc2c5b6c
  Usage:      decrypt, sign, unwrap
Certificate Object, type = X.509 cert
  label:      12266
  ID:         60b867e6dc2c5b6c
Certificate Object, type = X.509 cert
  label:
Certificate Object, type = X.509 cert
  label:
Private Key Object; RSA
  label:      me@vt.edu
  ID:         20110831
  Usage:      decrypt, sign, unwrap
Public Key Object; RSA 1024 bits
  label:      me@vt.edu
  ID:         20110831
  Usage:      encrypt, verify, wrap