I have OpenSSL x64 on Windows 7 which I downloaded from openssl-for-windows on Google Code. I'm attempting to run:
openssl pkcs12 -export -in "path.p12" -out "newfile.pem"
but I get an error.
unable to load private key
How do I extract the certificate in PEM from PKCS#12 store using OpenSSL?
Best Answer
Try:
After that you have:
To put the certificate and key in the same file without a password, use the following, as an empty password will cause the key to not be exported:
Or, if you want to provide a password for the private key, omit
-nodes
and input a password:If you need to input the PKCS#12 password directly from the command line (e.g. a script), just add
-passin pass:${PASSWORD}
: