DEV Community

Lemuel Okoli
Lemuel Okoli

Posted on

 

How to generate .key and .crt from PKCS12 file

How exactly would you generate a .key file and a .crt file from a .p12 file?

PFX: PFX (Personal Information Exchange) defines a file format commonly used to store private with accompanying public key certificates, protected with a password-based symmetric key (standard-PKCS12).

PEM: Openssl usages PEM (Privacy Enhanced Mail Certificate) to store the private key.

If you have the OpenSSL then go to command prompt and run the following commands:

openssl pkcs12 -in filename.pfx -nocerts -out filename.key

openssl pkcs12 -in filename.pfx -clcerts -nokeys -out filename.crt 

And if you want to save the key without a passphrase, add -nodes (no DES) before the -out.

OpenSSL can be downloaded here:

source
binaries

Cheers!🍻

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git