Enter PEM pass phrase when converting PKCS#12 certificate into PEM

Leem.fin picture Leem.fin · Nov 3, 2016 · Viewed 25.4k times · Source

I am using OpenSSL to convert my "me.p12" to PEM. When I generate "me.p12", I set a password for it. The "me.p12" contains a private key and a certificate.

When I convert it to PEM, I run command:

openssl pkcs12 -in me.p12 -out me.pem

Then, it asked me for Import Password:

Enter Import Password:
MAC verified OK

I entered the password I set to "me.p12", it was verified OK. But next, it ask me:

Enter PEM pass phrase:

I have no idea what is that? When I generate "me.p12" I haven't set any other password. So, what is that? How to figure this out?

Answer

dsbajna picture dsbajna · Feb 16, 2019

"Enter PEM pass phrase" because openssl doesn't want to output private key in clear text. The password is used to output encrypted private key

Below command can be used to output private key in clear text. No password is then asked.

openssl pkcs12 -nodes -in me.p12 -out me.pem