13.11.2014 Views

Smartcard quickstarter guide Why use smartcards? - GOOZE ...

Smartcard quickstarter guide Why use smartcards? - GOOZE ...

Smartcard quickstarter guide Why use smartcards? - GOOZE ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Smartcard</strong> <strong>quickstarter</strong> <strong>guide</strong><br />

Enter OpenSSL command prompt:<br />

$ openssl<br />

Copy the following line and paste it in OpenSSL command prompt:<br />

OpenSSL>engine dynamic -pre SO_PATH:/usr/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre LIST_ADD:1 -<br />

pre LOAD -pre MODULE_PATH:opensc-pkcs11.so<br />

(dynamic) Dynamic engine loading support<br />

[Success]: SO_PATH:/usr/lib/engines/engine_pkcs11.so<br />

[Success]: ID:pkcs11<br />

[Success]: LIST_ADD:1<br />

[Success]: LOAD<br />

[Success]: MODULE_PATH:opensc-pkcs11.so<br />

Loaded: (pkcs11) pkcs11 engine<br />

Under Mac OS X, you may need to enter the last command will full path to opensc-pkcs11.so, i.e.:<br />

OpenSSL>engine dynamic -pre SO_PATH:/Library/OpenSC/lib/engines/engine_pkcs11.so -pre ID:pkcs11 -pre<br />

LIST_ADD:1 -pre LOAD -pre MODULE_PATH:opensc-pkcs11.so<br />

Do not exit the OpenSSL command prompt.<br />

Step 3: Creating a self-signed certificate<br />

We are going to generate a certificate using this RSA key.<br />

Query available slots:<br />

$ pkcs11-tool --module /usr/lib/opensc-pkcs11.so --list-slots<br />

Slot 5 Feitian SCR301 01 00<br />

token label: François Pérou (User PIN)<br />

token manuf: EnterSafe<br />

token model: PKCS#15<br />

token flags: rng, login required, PIN initialized, token initialized<br />

serial num : 2998511513171109<br />

Under Mac OS X, you may need to enter the last command will full path to opensc-pkcs11.so, i.e.:<br />

$ pkcs11-tool --module /Library/OpenSC/lib/engines/engine_pkcs11.so --list-slots<br />

The smart card is in slot 5.<br />

The RSA key has ID c6f280080fb0ed1ebff0480a01d00a98a1b3b89a.<br />

The corresponding SSL id is: slot_5-id_c6f280080fb0ed1ebff0480a01d00a98a1b3b89a<br />

The syntax is slot_-id_<br />

Copy the following line, enter your values and paste it in OpenSSL command prompt:<br />

$ OpenSSL>req -engine pkcs11 -new -key slot_5-id_c6f280080fb0ed1ebff0480a01d00a98a1b3b89a -keyform<br />

engine -x509 -out cert.pem -text<br />

Will then asked for PIN and certificate information:<br />

Copyright <strong>GOOZE</strong> 2010-2011 http://www.gooze.eu 42 / 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!