Assemble a digital ID (PKCS#12 file)
A complete digital ID contains the following components:
the private key
This key can be taken from the file xxx.key
above.
the corresponding certificate with the public key
Ths certificate is sent to you by email from the certification
authority. You can save the attachment as
xxx.crt
.
the certificates of the intermediate certification
authorities
These certificates can be found either following the corresponding
link in this email or simplier on the page CA certificates in the table column
“X.509 chain”. You can save the file “Text
(without root)” as xxx.chain
.
To assemble these parts to a PKCS#12 file use this command (type everything in
one line):
openssl pkcs12 -export
-certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES
-macalg SHA1 -macsaltlen 32 -iter 2000
-inkey xxx.key
-in xxx.crt
-certfile xxx.chain
-name "New digital ID"
-out xxx.p12
In place of New digital ID
you should give
name and date or similar details. Many programs use this name when
displaying a list of digital IDs.
A PKCS#12
is always encrypted with a password. So you are asked both for the
password of the private key file and twice for a new password for the
digital ID.
The options -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES
-macalg SHA1 -macsaltlen 32 -iter 2000
are basically not
necessary. They specify the exact encryption methods and are selected
so that the generated file is also accepted by older software without
significantly reducing security.
If you are not sure which intermediate certificates you need, you
can let them pick automatically. Save this file as all-ca.pem
and
use this command (type everything in one line):
openssl pkcs12 -export
-certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES
-macalg SHA1 -macsaltlen 32 -iter 2000
-inkey xxx.key
-in xxx.crt
-chain -CAfile all-ca.pem
-name "New digital ID"
-out xxx.p12