23.11.2014 Views

CRIPTOGRAFIA - FESP

CRIPTOGRAFIA - FESP

CRIPTOGRAFIA - FESP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Important : the --id has to be the exact same as the one you used to store the<br />

client1.crt<br />

(here:DC:EF:ED:19:74:73:DA:44:B6:A4:EE:F5:8B:1F:C5:43:33:2D:1F:A0)<br />

Now, to access the key with openvpn you can use the following commands:<br />

openvpn --show-pkcs11-slots /usr/lib/opensc-pkcs11.so<br />

openvpn --show-pkcs11-objects /usr/lib/opensc-pkcs11.so 0<br />

Note this part of the output (example from my test key):<br />

You can access this token using<br />

--pkcs11-slot-type "label" --pkcs11-slot "OpenSC Card (PKyves)" options.<br />

And note also the subject for the client1 keyring. which in my example is:<br />

Object<br />

Type:<br />

Certificate<br />

CKA_ID:<br />

dc ef ed 19 74 73 da 44 b6 a4 ee f5 8b 1f c5 43<br />

33 2d 1f a0<br />

CKA_LABEL:<br />

Client1<br />

subject:<br />

/C=FR/ST=Ile-de-<br />

France/L=Paris/O=Mandriva/CN=client1/emailAddress=ybourhis@mandriva.com<br />

serialNumber: 03<br />

notBefore:<br />

060621144856Z<br />

after having noted these down, I will modifie the client's configuratin file<br />

(/etc/openvpn.client.conf) by removing the cert and key lines, and I'll replace<br />

them with what follows:<br />

pkcs11-providers /usr/lib/opensc-pkcs11.so<br />

pkcs11-slot-type "label"<br />

pkcs11-slot "OpenSC Card (PKyves)"<br />

pkcs11-id-type subject<br />

pkcs11-id "/C=FR/ST=Ile-de-<br />

France/L=Paris/O=Mandriva/CN=client1/emailAddress=ybourhis@mandriva.com"<br />

Now, each time the client is started, the PIN key will be asked before connection.<br />

Next, Configure Shorewall or go back to the Table of contents<br />

Client (PC2) Configuration:<br />

urpmi openvpn<br />

cd /etc/openvpn/<br />

cp -r /usr/share/openvpn/sample-config-files/client.conf /etc/openvpn/<br />

in case of self build rpm, replace the last command from above by:<br />

cp -r /usr/share/doc/openvpn-2.x.x/sample-config-files/client.conf /etc/openvpn/

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

Saved successfully!

Ooh no, something went wrong!