DEV Community

Lemuel Okoli
Lemuel Okoli

Posted on

9 1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

đź‘‹ Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay