Bước 2: Lấy ID thiết bị etoken.
Openvpn sẽ được cấu hỡnh tỡm đến đỳng ID của thiết bị token lưu khúa. Để lấy được thụng số ID cần thực hiện trỏ tới thư viện hỗ trợ thiết bị.
openvpn --show-pkcs11-ids /home/anhdoan/epass3003/redist/libshuttle_p11v220.so.1.0.0
Certificate DN: /C=US/ST=CA/L=SanFrancisco/O=Fort- Funston/CN=etoken/emailAddress=me@myhost.mydomain Serial: 03 Serialized id: Feitian\x20Technologies\x20Co\x2E\x2C\x20Ltd\x2E/ePass3003Auto/01215116090405 10/ePass/66393932353833302D376166312D313165312D383534642D30303063323935 3937336161
Bước 3: Tạo khúa dạng pksc12 và lưu khúa vào thiết bị etoken Tạo khúa
./build-key-pkcs12 epass3003
Generating a 1024 bit RSA private key ...++++++
....++++++
writing new private key to 'epass3003.key' ---
You are about to be asked to enter information that will be incorporated into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank
For some fields there will be a default value, If you enter '.', the field will be left blank. ---
Country Name (2 letter code) [US]: State or Province Name (full name) [CA]: Locality Name (eg, city) [SanFrancisco]:
Organization Name (eg, company) [Fort-Funston]: Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) [epass3003]: Name []:
Email Address [me@myhost.mydomain]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/2.0/openssl.cnf Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows countryName :PRINTABLE:'US' stateOrProvinceName :PRINTABLE:'CA' localityName :PRINTABLE:'SanFrancisco' organizationName :PRINTABLE:'Fort-Funston' commonName :PRINTABLE:'epass3003' emailAddress :IA5STRING:'me@myhost.mydomain'
Certificate is to be certified until Apr 25 02:55:17 2022 GMT (3650 days) Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries
Data Base Updated
Bước tiếp theo lưu khúa dạng pkcs12 vào thiết bị epass3003.