Skip to content

How to Convert the .pem Certificate to .pfx format

Last updated on July 6, 2023

To convert a .pem certificate to .pfx format using OpenSSL, you can use the following OpenSSL command:

openssl pkcs12 -export -inkey private_key.pem -in certificate.pem -out certificate.pfx

Here’s what each parameter represents:

  • -export: Specifies that the output should be an export file in .pfx format.
  • -inkey private_key.pem: Specifies the path to the private key file in .pem format.
  • -in certificate.pem: Specifies the path to the certificate file in .pem format.
  • -out certificate.pfx: Specifies the output path and filename for the converted .pfx file.

Make sure you have OpenSSL installed on your system and replace private_key.pem, certificate.pem, and certificate.pfx with the appropriate filenames and paths for your certificate files.

When you run the command, OpenSSL will prompt you to enter a password to protect the .pfx file. You’ll need to remember this password, as it will be required when using the .pfx file in applications that require it.

After running the command successfully, you will have a converted .pfx file that contains both the private key and the certificate in a single file, ready to be used in applications that require a .pfx certificate

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments