To create a PKCS12 file using OpenSSL follow the steps listed below:
- 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.
- 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)
- 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