Skip to content
theDXT
  • Home
  • IT
  • Scripts
  • GitHub
  • LinkedIn
  • X (Twitter)
  • Search Icon
Convert PEM to PFX Certificate

Convert PEM to PFX Certificate

November 19, 2024

Sometimes, you have a certificate in PEM format as a CRT file (also called a CER file) with a key file (also called a PEM file), and you need to combine and convert them into a PFX certificate.

In this post, I will show you step-by-step how to convert a PEM certificate into a PFX file.

Prerequisites

  • OpenSSL binary installed. You can find the OpenSSL binaries on the OpenSSL wiki.
  • Private key file
  • SSL Certificate

The Process

  • Place everything in a working directory.

I will be using C:\SSL as my working directory.

  • Open the command line. You can use Linux or Windows. The commands are all the same regardless of which OS you are using.

I will be using Microsoft Windows with Windows Terminal and PowerShell.

To convert the certificate using OpenSSL, we will need to use a few options to create our command.

  • The options we will use are
    • pkcs12 to tell OpenSSL that we will be working with a PKCS#12 file. PKCS#12 is another name for a PFX file.
    • inkey to tell OpenSSL which private key to use.
    • in to tell OpenSSL which certificate file to use.
    • export to tell OpenSSL we want to export a PKCS#12 file.
    • out to tell OpenSSL where to save the converted certificate.
  • Run the following command to convert the certificate into a PFX file. Replace PATH_TO_KEY and PATH_TO_CERT with the location of your certificate and private key, and replace PATH_TO_PFX with where you want the PFX file saved. openssl pkcs12 -inkey PATH_TO_KEY -in PATH_TO_CERT -export -out PATH_TO_PFX

In my example, I have a private key named private.key, and my certificate file is named star_thedxt_ca.crt. I also want to create a PFX file named wild_thedxt_ca.pfx. The command for me will look like openssl pkcs12 -inkey private.key -in star_thedxt_ca.crt -export -out wild_thedxt_ca.pfx

  • Enter the password for the private key.
  • Create a password for the PFX file.

That’s it. You have now combined and converted the private key and the PEM certificate into a PFX certificate.

Related posts:

Convert PFX Certificate Generate CSR with OpenSSL Export a Certificate with MMC Broken Certificate Chain

IT
Certificates, Convert, How To, Linux, OpenSSL, SSL, Windows

Post navigation

PREVIOUS
Generate CSR with OpenSSL
NEXT
Palo Alto Certificate Chain Fix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About Me

Daniel Keer

Project Lead, Senior Consultant at Digitally Accurate Inc.

Awards and Certificates
VMware vExpert ⭐⭐⭐⭐
Omnissa Tech Insider ⭐⭐⭐

Consulting

Stuck on something? Reach out to Digitally Accurate Inc. and we can provide expert IT consulting to help you move forward.

  • ESX Regenerate Self-Signed Certificate
  • Veeam Backup & Replication 13 Windows Install
  • Enable Windows 10 Extended Security Updates
  • slmgr.vbs
  • CyberChef

Recent Posts

  • ESX Regenerate Self-Signed Certificate
  • Veeam Backup & Replication 13 Windows Install
  • Enable Windows 10 Extended Security Updates
  • slmgr.vbs
  • CyberChef
  • Install or Upgrade Duo Authentication for Windows Logon
  • Install Matrix
  • Duo Authentication Proxy Upgrade
  • VMware Home Lab Tokens
  • I Went to Workplace Ninjas US 2025

About Me

Daniel Keer

Project Lead, Senior Consultant at Digitally Accurate Inc.

Awards and Certificates
VMware vExpert ⭐⭐⭐
Omnissa Tech Insider ⭐⭐

Consulting

Stuck on something? Reach out to Digitally Accurate Inc. and we can provide expert IT consulting to help you move forward.

Tags

2014 Calgary Certificates Christmas EUC event Fix holiday How To Microsoft Microsoft 365 Mouthy & Keerious Networking podcast Power Loss PowerShell review Script Spoiler Free twelve days of christmas Upgrade VEDA VEDA 2015 video vlog Vlog Every Day in April VMware Windows youtube yyc

© 2026   Copyright. All Rights Reserved.