Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Where Windows Stores Certificates and Private Keys

January 21, 2026

Where Windows Stores Certificates and Private Keys

The following graphical MMC snap-ins are typically used to manage certificates in Windows: certlm.msc (Local Machine certificates), certmgr.msc (User Certificates), and the certutil command-line utility. All these tools interact with the logical certificate stores, which abstract the physical locations of public and private certificate keys on disk and in the registry from end users and apps.

Contents:
  • Logical and Physical Certificate Store Locations in Windows
  • Extracting Certificates from the Windows Registry

Logical and Physical Certificate Store Locations in Windows

Certificate public and private keys in Windows are not stored in the same central place.  The certificates’ public keys are stored in the registry (can be extracted), but their private keys (if any) are stored on the file system and are encrypted.

By default, the Windows Certificate Manager (certmgr.msc) displays only a logical view of certificate stores. To view the physical certificate stores in the console, select View -> Options from the menu and enable the Physical certificate stores. The console will now display certificate keys grouped by their physical storage location (registry, local computer, smart card, etc.).

View Physical certificate stores in Windows

Certificates in the registry:

Certificate StoreRegistry keyDescription
UserHKCU\SOFTWARE\Microsoft\SystemCertificatesPublic keys of user certificates
UserHKCU\SOFTWARE\Policies\Microsoft\SystemCertificatesPublic keys of user certificates deployed using AD Group Policies
ComputerHKLM\SOFTWARE\Microsoft\SystemCertificatesMachine certificate public keys
ComputerHKLM\SOFTWARE\Microsoft\Cryptography\ServicesPublic keys of common services
ComputerHKLM\SOFTWARE\Policies\Microsoft\SystemCertificatesPublic keys of machine certificates installed via GPO
ComputerHKLM\SOFTWARE\Microsoft\EnterpriseCertificatesThe machine’s public keys were installed from an enterprise CA in an AD domain.

Certificate private keys on a system drive:

User%APPDATA%\Microsoft\SystemCertificatesThis directory stores user public keys and pointers to private certificate keys.
User%APPDATA%\Microsoft\CryptoUser private key containers
Computer%ProgramData%\Microsoft\CryptoMachine private key containers
Windows uses a master encryption key based on the user’s login password to protect certificate private keys with DPAPI encryption. This ensures that only the account owner, who knows the password, can decrypt the private keys. This protects private keys if an attacker resets the local administrator password on a machine. 

Similar to how you access objects on the file system, you can access the logical certificate store from PowerShell using the built-in Cert provider.

For example, this is a PowerShell command used to navigate to the computer’s certificate store.

cd Cert:\LocalMachine\my

List certificates in the LocalMachine store:

Get-Item *

powershell - list LocalMachine\my certificates

Or, you can use the certutil command to list the machine certificates:

certutil -store MY

Extracting Certificates from the Windows Registry

The certificates are stored under the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\MY registry key. They can be identified by their thumbprint in the registry key name. The data for each certificate is stored in a BLOB binary value containing the full certificate in DER-encoded format.

Certificates thumbprints in the registry

Use this PowerShell script to extract BLOB certificate data from the registry by its thumbprint. Then, convert the data to X509Certificate2 format and print the certificate information:

$regPath = "HKLM:\SOFTWARE\Microsoft\SystemCertificates\MY\Certificates\D9DA2EDD7CBC0EFBF476276672DEBFD56870AAF8"
$blob = (Get-ItemProperty -Path $regPath).Blob
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList (, $blob)
$cert | Format-List Subject, Issuer, NotBefore, NotAfter, Thumbprint

PowerShell: extract x509 certificate info from the registry

To export this public key certificate as a CER file (for transfer to another computer), run the following commands:

$certBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Cert)
[System.IO.File]::WriteAllBytes("c:\temp\exported_certificate.cer", $certBytes)

export certificate key from a registry to CER file using PowerShell

This approach is useful for analyzing the certificate store of a failed system by extracting data from its offline registry hives. This allows you to extract all the public parts of the certificates installed on a computer.

Use the RecoverOfflineCertificate script to export private keys from an offline computer.
0 comment
0
Facebook Twitter Google + Pinterest
PowerShellQuestions and AnswersWindows 10Windows 11
previous post
How to Extract Printer Drivers from Windows

Related Reading

Change BIOS from Legacy to UEFI without Reinstalling...

April 23, 2025

How to Prefer IPv4 over IPv6 in Windows...

April 15, 2025

Find a Process Causing High Disk Usage on...

July 16, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

How to Detect Which User Installed or Removed...

June 25, 2025

Fix: The referenced assembly could not be found...

March 25, 2025

How to Move (Migrate) Existing Windows Shares to...

December 24, 2025

Unable to Select Edition During Windows 10/11 Installation

February 4, 2025

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • How to Remove Old (Unused) PowerShell Modules

    January 12, 2026
  • How to Move (Migrate) Existing Windows Shares to a New File Server

    December 24, 2025
  • Using KDC (Kerberos) Proxy in AD for Remote Access

    December 23, 2025
  • Windows: Create (Install) a Service Manually

    December 16, 2025
  • Windows: Auto Switch to Strongest Wi-Fi Network

    December 10, 2025
  • How to Enable or Disable VBScript in Windows after Deprecation

    December 10, 2025
  • Start Menu Not Working (Unresponsive) on Windows Server RDS

    November 27, 2025
  • AppLocker: Configure Application Restriction Policies in Windows

    November 19, 2025
  • Enable/Disable Random Hardware (MAC) Address for Wi-Fi on Windows

    November 14, 2025
  • Automate Software and Settings Deployment with WinGet Configure (DSC)

    November 13, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Automate Software and Settings Deployment with WinGet Configure (DSC)
  • Run Elevated Commands with Sudo on Windows 11
  • Fix: Slow Startup of PowerShell Console and Scripts
  • How to Pause (Delay) Update Installation on Windows 11 and 10
  • Enable/Disable Random Hardware (MAC) Address for Wi-Fi on Windows
  • Allow Ping (ICMP Echo) Responses in Windows Firewall
  • How to Disable PowerShell on Windows for Non-Admin Users
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top