Ask a Question

Advanced Search

Solution ID : SO25984

Last Modified : 05/02/2018

How to create a PKCS12 file using OpenSSL

Problem

 
How to create a PKCS12 file using OpenSSL
 

Solution

To create a PKCS12 file using OpenSSL follow the steps listed below:

  1. Copy the private key and SSL certificate to a plain text file. The private key should go on top with the SSL certificate below. In the example, we use "filename.txt" as the name of the file containing the private key and SSL certificate.
     
  2. Run the following openssl command:

    openssl pkcs12 -export -in filename.txt -out filename.p12

    You should be prompted in this order:

    • Loading 'screen' into random state - done
    • Enter pass phrase for filename.txt: (Enter the private key password)
    • Enter Export Password: (This will be the password for the new PKCS12 file)
    • Verifying - Enter Export Password: (Confirm the password)
    • unable to write 'random state' (If this this error appears, please ignore)
       
  3. If a location is not specified, the new PKCS12 file will be located within the directory from where the OpenSSL command was executed.
     

For more information concerning OpenSSL please visit: www.openssl.org