PFX File

Theory

A .pfx file, or Public Key Cryptographic Standard #12 file, contains a digital certificate and its corresponding private key file for Windows servers. The .pfx file is used to store the public key (SSL certificate file) and the private key file, which are required for an SSL certificate to function. The .pfx file is a secure way to store important cryptographic assets in a password-protected bundle.


Practical

Extract Private Key from PFX file

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [drlive.key]

You will be prompted to type the import password. Type the password that you used to protect your keypair when you created the .pfx file. You will be prompted again to provide a new password to protect the .key file that you are creating. Store the password to your key file in a secure place to avoid misuse.

Extract Certificate from PFX file

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [drlive.crt]


REFERENCES

Last updated