Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Windows Server » Export and Convert Private Keys to .PEM Format in Windows
  • banner 1
    How to Hide or Block Wi-Fi Networks on Windows Network | Monitoring
  • Was ist Windows Server und wie unterscheidet er sich vom normalen Windows
    Create a certificate template for BitLocker Network Unlock Windows Server
  • Migrate from Universal Analytics to GA4 property
    Configure and Migrate from Universal Analytics to GA4 property Automation
  • Virtual Desktop
    Add and Remove Multiple Virtual Desktops in Windows Windows
  • Screenshot
    Setup iSCSI Target and Storage LUN on Synology DS923+ for VBR Reviews
  • Steps to upgrade VBR to v12.1
    How to upgrade Veeam Backup and Replication v11 to 12.1 Backup
  • Prevent OS Reinstallation When Switching from Legacy BIOS to UEFI
    Prevent OS Reinstallation: Change from legacy BIOS to UEFI Windows
  • ntp server testen
    Enable or disable Linux System’s Clock Sync with NTP Server Linux

Export and Convert Private Keys to .PEM Format in Windows

Posted on 20/03/202525/03/2025 Christian By Christian No Comments on Export and Convert Private Keys to .PEM Format in Windows
certificate import and export on windows

Microsoft Management Console (MMC) does not natively export private keys in .PEM format. Instead, it exports private keys in .PFX (.PKCS#12) format which includes both the certificate and private key in an encrypted container. If you need the private key in PEM format, you must first export the certificate as PFX from MMC and then convert it using OpenSSL. Therefore in this article, we shall show you how to Export and Convert Private Keys to .PEM Format in Windows. Please, see Convert a PEM Key to a PPK Key on a Linux and Windows, and how to “Create a self-signed certificate and export it in PFX format via PowerShell [Part 1]“.

SSL is essential for Windows Admin Center (WAC) to ensure secure, encrypted communication, especially since the latest WAC Modern Gateway (WACmg) self-signed certificate expires after 60 days. This requires a trusted SSL certificate for long-term stability and uninterrupted access

Note: PFX (.pfx) and PKCS#12 (.p12) formats are the same. Both are used to store a private key along with its corresponding certificate (and, optionally with the entire certificate chain) in a single encrypted file. The .pfx extension is used in Windows environments. While .p12 is more common in Unix-based systems. However, they are interchangeable and can be rename from a .pfx file to .p12 without affecting functionality.

Also, see how to generate a self-signed certificate and export in PFX format via PowerShell [Part 2], how to Fix Trellix ePO DAT and Engine Packages missing, and how to deploy and integrate VHR with VBR.

Error Code returned from the cryptographic module is 0x8009030D

A fatal error occurred when attempting to access the TLS server credential private key. The error code returned from the cryptographic module is 0x8009030D. The internal error state is 10001. The SSPI client process is WindowsAdminCenter (PID: 368), as shown in the image below.

Fatal error occured when attempting to accept the TLS server credential private key

The error “A fatal error occurred when attempting to access the TLS server credential private key” (Error Code 0x8009030D, Internal State 10001) indicates that the Windows Admin Center (WAC) is unable to access the private key of the SSL certificate. This occurs due to insufficient permissions on the private key or because the certificate is missing an associated private key.

Please, see best Storage for Veeam: Comparing OOTBI by ObjectFirst to VHR, how to create a bootable USB on Mac: Proxmox VE Setup, and How to generate CSR and Request a Certificate from Herica CA.

Fix Error Code 0x8009030D, Internal State 10001

Windows, including Windows Admin Center (WAC), primarily expects PFX (.p12) format for certificates. If you import a certificate in PEM format. This will result in issues, including the TLS private key access error (0x8009030D, state 10001).

An easier approach to this would be to Import the PEM file to Certificate Store and Export as PFX.
Note: If your PEM file contains only the certificate, the private key must be imported separately. Lastly, export the Certificate as PFX.

Please, see Upgrade Windows Admin Center 2306 – 2311: Run WACmg v2401, how to configure WebLAPS to manage Microsoft LAPS, and how to Shrink and Compact Virtual Hard Disks in Hyper-V.

To avoid the workaround below, contact your certificate vendor for a certificate with the private key. Import the cert and do the binding with WAC. You can also take a look at this solution.

Workaround: Export the Certificate with Private Key

If you need the private key in PEM format. First, export the certificate as PFX from MMC and then convert it using OpenSSL or Herica web tool. Here is an article on how to export a certificate in PFX format in Windows. You could also do this via the command line as shown below.

openssl pkcs12 -in cert.pfx -nocerts -nodes -out privatekey.pem

To do this over the MMC, launch MMC and navigate to File. Next, click on Add/Remove Snap-in. Select Certificates and click on Add and Ok to add the snap-in and OK. Next, select Computer account and then Local Computer and click on Finish to complete it.

Add certificate snapin

Expand Personal and then Certificates. Find your certificate, right-click it and select All Tasks and Export.

Export certificate

From the Certificate Export Wizard, click on Next.

certificate export wizard

Select “Yes, export the private key”, and click Next to proceed.

export private key

Next, check.PFX (PKCS #12) format.
– Include all certificates in the certification path.
– Set a password for security.
– Enable Certificate Privacy and click Next.

file format export

Enable Password and confirm password and click Next.

password protect private key

Browse to the path you wish to save the file and click next.

file to export

Click on Finish to complete the export.

finish private key export

As you can see below, the certificate and the private key has been successfully exported.

export was successful

Please, see how to configure SSL for WAMP server, how to fix Apache errors associated with WAMP installation for TeamPass, and how to uninstall WAMPServer from Windows.

Install OpenSSL

Note: Now that we have the .PFX file, we need to convert it to .PEM format to bundle the private key, public key, and certificate chain together. This step requires installing openssl on Windows. Here is a guide on how to Install OpenSSL on Windows Computers.

First, you will have to download the latest version of OpenSSL from here and install it.

install openssl

I am okay with the default installation path. Click Next to proceed.

destination path for openssl

Click on Next to continue with the installation

menu for openssl

Select Windows System Directory and click Next

ssl additional tasks

If you are interested in donating which I will strongly advise you to do. Select any of the options and click Finish.

finish

Please, see fix Task failed to perform Scheduled Snapshot Replication, how to deploy Azure Virtual Desktop in Azure Portal, and how to correctly uninstall Nextcloud from Mac.

Create Environment Variable

We will have to create an environment variable. This ensures OpenSSL ensures that you can run OpenSSL commands from any terminal or command prompt without needing to specify or navigate to the full installation path.

To do this, launch the system properties, click on Advanced and then Environment Variables. Under System Variables, find Path and click Edit. As shown below, add the following path C:\Program Files\OpenSSL\bin

add environemnt variable for openssl

Click OK and restart the terminal or system for changes to take effect. After setting the environment variable, you can simply run “openssl version” from any part of the command prompt to determine the openssl version.

openssl version

By the way, you can also do this from the command line by running the following command below.

[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\OpenSSL\bin", [System.EnvironmentVariableTarget]::Machine)

Here is How to upgrade Veeam Backup and Replication 12.3, how to how to install Veeam Backup Console on a Jump Server, and how to Mitigate Veeam Threat Hunter Service Scanning Interference.

Convert PFX to PEM (Extract Private Key)

The goal of this section is to repackage the certificate components (private key, certificate, and chain) into a new PFX (.p12) file that will be renamed into .pfx that is properly formatted for Windows systems to consume. To do this, we will have to use OpenSSL to extract the private key.

openssl pkcs12 -in exported-cert.pfx -nocerts -nodes -out private-key.pem
covert to pem and extract private keys

Extract the certificate (certificate.pem)

openssl pkcs12 -in exported-cert.pfx -clcerts -nokeys -out certificate.pem
Extract the certitificate

Also, see how to get MBAM BitLocker Recovery Keys from Microsoft SQL Server, how to Prevent Microsoft Teams from starting automatically on Windows, and how to Fix Windows Server frequent disconnects and shutdown.

Covert to p12 Format on Harica

With HARICA Tool, you can convert .pem files to .p12. This will be subsequently renamed to .pfx and imported to the certificate store. You will need the certificate, the private key (exported and converted) and the Issuing Authority.

download pem format needed for conversion

Now, you can use the Harica tool to convert to .p12 format and rename to .pfx as you wish for Windows to consume.

convert to p12 format

Shortly, the p12 certificate format will be downloaded and then renamed to .pfx.

Please, see Install Remote Server Administration Tools on Windows 11, how to deploy Folder Redirection in Windows and Sign-in options for Windows: Ditch Password for Enhanced Security.

Alternative Step: Via the OpenSSL Tool: Convert PEM to PFX (.p12) Directly

You could use OpenSSL on the fly to convert from PEM to PFX /(.p12) directly ff you have:

  • Certificate file: certificate.pem
  • Private key file: private-key.pem
  • (Optional) CA Bundle: ca-bundle.pem

Run this OpenSSL command:

openssl pkcs12 -export -out final-cert.pfx -inkey private-key.pem -in certificate.pem -certfile ca-bundle.pem
  • export: Converts everything into PFX format
  • out final-cert.pfx: The output file (PFX)
  • inkey private-key.pem: Uses the private key
  • in certificate.pem: Uses the public certificate
  • certfile ca-bundle.pem: (Optional) Includes the CA chain, if required.

When prompted to set a password for the PFX file, please use something secure.

Import Certificate into Certificate Store

Once you have converted the certificate as discussed above to the desired format such as .pfx (renamed from .p12) in my case. The next step is to import the certificate to the certificate store. Follow the same steps to launch MMC and this time, instead of “Export”, select “Import” as shown below.

certificate import into personal store

Click Next on the certificate import wizard

import wizard

Browse to certificate

browse to certificate

Enter the password and ensure the below fields are selected and click next.

password protct private key

Select the option “Place all certificates in the following Store” and click Next

select certificate store

Click on Finish to complete the certificate import.

certificate import completed

As you can see below, we have successfully imported the certificate to the certificate store.

import successful

I hope you found this article useful on how to Export and Convert Private Keys to .PEM Format in Windows. Please feel free to leave a comment below.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Windows, Windows Server Tags:Certificate Authority, Certificate Signing Request, Certificates, ssl certificate, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post: Fix Trellix ePO DAT and Engine Packages missing
Next Post: In-place upgrade of Windows Server 2022 to 2025

Related Posts

  • article 1280x720.192a2586 1
    How to remove an MDT Deployment Share Windows Server
  • RDS Collection 1
    How to add and remove RDS Collection Windows
  • update
    Client Visibility Issues: Fix WSUS Clients appear then disappear in the console Windows Server
  • screenshot 2020 03 20 at 16.10.20
    How to install Ansible on Windows with Cygwin Windows Server
  • wac
    Fix Windows Admin Center cannot be reached Windows
  • Windows Server 2016 1
    All About Windows Server 2016 Windows Server

More Related Articles

article 1280x720.192a2586 1 How to remove an MDT Deployment Share Windows Server
RDS Collection 1 How to add and remove RDS Collection Windows
update Client Visibility Issues: Fix WSUS Clients appear then disappear in the console Windows Server
screenshot 2020 03 20 at 16.10.20 How to install Ansible on Windows with Cygwin Windows Server
wac Fix Windows Admin Center cannot be reached Windows
Windows Server 2016 1 All About Windows Server 2016 Windows Server

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • banner 1
    How to Hide or Block Wi-Fi Networks on Windows Network | Monitoring
  • Was ist Windows Server und wie unterscheidet er sich vom normalen Windows
    Create a certificate template for BitLocker Network Unlock Windows Server
  • Migrate from Universal Analytics to GA4 property
    Configure and Migrate from Universal Analytics to GA4 property Automation
  • Virtual Desktop
    Add and Remove Multiple Virtual Desktops in Windows Windows
  • Screenshot
    Setup iSCSI Target and Storage LUN on Synology DS923+ for VBR Reviews
  • Steps to upgrade VBR to v12.1
    How to upgrade Veeam Backup and Replication v11 to 12.1 Backup
  • Prevent OS Reinstallation When Switching from Legacy BIOS to UEFI
    Prevent OS Reinstallation: Change from legacy BIOS to UEFI Windows
  • ntp server testen
    Enable or disable Linux System’s Clock Sync with NTP Server Linux

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,839 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.