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:

  1. Convert the certificate from PEM to PKCS12 format using the following:

    openssl pkcs12 -export -out pkcscertificate.p12 -inkey certificatekey.pem -in inputcertificate.pem 
  2. 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 
  3. Convert the private key to a PKCS8 key using the following:

    openssl pkcs8 -in privatekey.pem -topk8 -nocrypt -out privatekey.p8