Obtaining the Private key
This section describes how to obtain the private key from a certificate.
To obtain the private key, perform the following procedure:
-
Convert the certificate from PEM to PKCS12 format using the following:
openssl pkcs12 -export -out pkcscertificate.p12 -inkey certificatekey.pem -in inputcertificate.pem
-
Extract the private key from the PKCS12 certificate created in the previous step by using the following:
openssl pkcs12 -in pkcscertificate.p12 -nocerts -nodes -out privatekey.pem
-
Convert the private key to a PKCS8 key using the following:
openssl pkcs8 -in privatekey.pem -topk8 -nocrypt -out privatekey.p8