banner



How To Open Certificate Manager In Windows Server 2008 R2

If you're a Windows system administrator, you might have been forced to work with windows certificates. Working with certificates in Windows is typically ane of those extra hats a sysadmin has to accept on. Using the Windows document director as a tool, you can exercise it!

Certificates are notoriously circuitous and hard to understand but in this article, y'all'll get a chance to discover certificates aren't that scary in Windows!

This commodity will cover mainly working with certificates in Windows. If you'd like to learn more almost how certificates work in general, check out this commodity'southward companion X.509 Certificate Tutorial article.

Understanding Document Stores

Within the Windows certificate managing director, all certificates exist in logical storage locations referred to as document stores. Certificate stores are "buckets" where Windows keeps all certificates that are currently installed and a certificate can be in more than 1 store.

Unfortunately, certificate stores are non the nearly intuitive concept with which to work. You volition read almost how to differentiate these stores and how to work with them beneath.

Each shop is located in the Windows Registry and on the file system. Refer to the below tabular array for details. When working with a certificate in a shop, you are interfacing with the logical store; non directly modifying the registry or file organisation. This simpler manner lets you work with a unmarried object while Windows takes intendance of how to represent that object on disk.

You lot'll sometimes see certificate stores referred to as physical or logical stores. Concrete stores reference the actual file system or registry location where the registry key(south) and/or file(s) are stored. Logical stores are dynamic references that reference one or more physical stores. Logical stores are much easier to piece of work with than concrete stores for most mutual use cases.

Windows stores certificates in 2 dissimilar areas – a user and computer context. A certificate is placed in i of these two contexts depending on if the document should be used by a single user, multiple users, or the computer itself. For the residuum of this article, a document in a user and computer context will be informally called user certificates and computer certificates.

User Certificates

If you intend for a certificate to exist used past a single user, then a user document store inside the Windows certificate manager is ideal. This is the mutual employ example for document-based hallmark processes such as wired IEEE 802.1x.

User certificates are located within the electric current user'south profile and are only logically mapped within that user's context. User certificates are "mapped" and are unique for each user, even on the aforementioned systems.

Reckoner Certificates

If a document will be used by all users on a figurer or a arrangement process, it should be placed inside of a store in the computer context. For example, if a certificate will be used on a spider web server to encrypt advice for all clients, placing a document in a shop in the computer context would be ideal.

Y'all'll run into that a calculator'south certificate store is logically mapped for all user contexts. This allows for certificates in a calculator document store to be used past all users, depending on the permissions configured for the private central.

For more information on private keys, be certain to check out the article X.509 Certificates Tutorial: A Sysadmin Guide.

Computer certificates are located in the Local Car Registry hives and the Programme Data folder. User certificates are located in the Current User Registry hives and the App Information binder. Below you lot can encounter a breakdown of where each type of shop is located in the registry and file system.

Context Registry Path Explanation
User HKCU:\SOFTWARE\Microsoft\SystemCertificates\ Concrete store for user-specific public keys
User HKCU:\SOFTWARE\Policies\Microsoft\SystemCertificates\ Physical store for user-specific public keys installed by Agile Directory (AD) Group Policy Objects (GPOs)
Figurer HKLM:\SOFTWARE\Microsoft\SystemCertificates\ Physical store for machine-broad public keys
Calculator HKLM:\SOFTWARE\Microsoft\Cryptography\Services\ Physical store for keys associated with a specific service
Figurer HKLM:\SOFTWARE\Policies\Microsoft\SystemCertificates\ Physical store for motorcar-wide public keys installed by GPOs
Computer HKLM:\SOFTWARE\Microsoft\EnterpriseCertificates\ Concrete store for machine-wide public keys installed by the Enterprise PKI Containers within an AD domain
Context File Location Explanation
User $env:APPDATA\Microsoft\SystemCertificates\ Physical store for user-specific public keys and pointers to individual keys
User $env:APPDATA\Microsoft\Crypto\ Physical store for user-specific individual key containers
Calculator $env:ProgramData\Microsoft\Crypto\ Physical store for automobile-broad private key containers

Prerequisites

Throughout the rest of this commodity, you lot will find multiple examples showing interactions with Windows certificate stores. To replicate these examples, be sure you meet the following prerequisites:

  • Windows Vista, Windows Server 2008, or newer operating system. The examples shown use Windows ten Enterprise version 1903.
  • Familiarity with PowerShell. Although not required, this will be the language used to reference certificates where appropriate. The examples shown take all been created with Windows PowerShell 5.i.
  • Yous will not need any specific certificates installed to follow along, but using a cocky-signed certificate is benign.

Managing Certificates in Windows

In Windows, at that place are 3 master means to manage certificates:

  • The Certificates Microsoft Management Panel (MMC) snap-in (certmgr.msc)
  • PowerShell
  • The certutil command-line tool

In this article, you'll acquire how to manage certificates via the Certificates MMC snap-in and PowerShell. If you lot'd like to larn more near how to use certutil, bank check out the Microsoft Docs.

PowerShell vs. the Windows Security Document Manager

Since certificates can be managed a few different ways in Windows, which one practise you choose? Should you lot go the GUI (MMC) route or command-line with PowerShell?

Note: This article is relevant both for the Windows 7 Certificate Manager and Windows 10 Certificate Manager MMC snap-ins.

Outset, consider the lifecycle of a certificate. If you merely intend to install or remove a single certificate once, consider using the MMC. But if you're managing multiple certificates or discover yourself performing the aforementioned chore over and once more, the command-line route may be the style to go. Even if you don't know how to write PowerShell scripts, information technology'd be worth learning if you take many different certificates to manage.

Let'south first take a wait at how to notice the certificates installed on Windows using both the Document Manager and PowerShell.

Using the Windows Certificate Manager (certmgr.msc)

To view certificates with the MMC, open up up the Certificate Managing director open up your Get-go menu and type certmgr.msc. This will bring up the Windows Certificates MMC. This initial view will provide an overview of all the logical stores displayed in the left window.

Yous tin see in the screenshot below the Trusted Root Certification Authorities logical store is selected.

Trusted Root Certification Authorities store
Trusted Root Certification Authorities store

Viewing Physical Stores

By default, the Windows certificate director volition not show the actual physical stores. To show the stores, click on View and so on Options. You will then meet options to choose to testify physical certificate stores. Enabling this pick makes identifying the specific paths inside Windows easier.

Figure 2 - The Certificates MMC View Options with Physical certificate stores selected.
Figure 2 – The Certificates MMC View Options with Physical certificate stores selected.

You can now see additional containers are shown under the instance Trusted Root Certification Authorities logical shop shown previously.  The certificates are even so grouped relative to their logical stores, but y'all can now see the physical store, "Registry".

Inspecting the physical cert stores
Inspecting the physical cert stores

Inspecting Attributes in the Windows Certificate Manager

There are many attributes of a certificate you can see when viewing them with the MMC. For instance, you will probable want to select specific certificates.

The easiest fashion for you to attain this is past referencing the certificate's Serial Number or Thumbprint extension value. If the document was signed by a document authority (CA), it will take a series number when issued. The Thumbprint is calculated every time the document is viewed.

You can run into some of the attributes for a document by opening information technology up in the MMC equally yous can see below.

Inspecting a Windows certificate
Inspecting a Windows certificate

One important feature to indicate out is embedded individual keys. Certificates in Windows can also accept a corresponding private primal. These private keys are stored in respective physical stores every bit encrypted files.

To quickly distinguish a certificate with and without a respective individual key, expect at the certificate icon. In the Windows certificate managing director, if the icon simply looks like a piece of paper with a ribbon, at that place is no corresponding private cardinal. If a certificate does have a private key, you will see a key in the MMC icon, and you will encounter a primal at the bottom of the General tab when you open the certificate.

Certificate without an embedded private key
Certificate without an embedded private key

Using PowerShell

Equally with the MMC, yous can view and manage certificates with PowerShell besides. Let'southward first inspect certificates in their concrete stores (the registry and file system).

Past Physical Store

Using the Become-ChildItem PowerShell cmdlet, y'all tin can enumerate all of the keys and values within of the parent HKCU:\Software\Microsoft\SystemCertificates\CA\Certificates\ registry key path.

The below command volition enumerate all of the currently-logged-in user'southward certificates in the Intermediate Certification Authorities logical shop.

            Get-ChildItem -Path HKCU:\Software\Microsoft\SystemCertificates\CA\Certificates\          

Each entry in the Registry hive you see will stand for to the Thumbprint of the document for a trusted CA and it's certificate in the respective property. You can run across an instance output of this below.

Results of the installed certificates from the example commands, limited to the first 5 entries.
Results of the installed certificates from the example commands, limited to the showtime 5 entries.

Another common shop is, the Personal store. Your certificates for this store are located on the file system rather than the Registry. In the post-obit commands we will show these different physical paths and their purposes.

Each file in the directory, returned past the command below, corresponds to a document installed in the Personal current user store.

            Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Certificates\          

Each file returned in the below command is a reference to the object for a private key created by the Fundamental Storage Provider (KSP). The file name corresponds to the Bailiwick Key Identifier of the certificate. Each private central you install will have a corresponding file added.

            Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Keys\          

Each file in the directory returned by the below control is the unique container for the encrypted private fundamental created by the KSP. In that location is no direct relationship between the file name and the certificate, but the file is the target of the arrow in the earlier command.

            Get-ChildItem -Path $env:APPDATA\Microsoft\Crypto\Keys          

Past Logical Store

Since working with certificates in their physical paths is uncommon, you will exist working with the logical stores for the rest of the examples.

PowerShell can access Windows logical stores using the Cert: PSDrive. The Cert: PSDrive maps certificates to the physical stores much like the MMC does.

Unfortunately, the MMC and the Cert PSDrive practice non label the logical stores the aforementioned. Below you can meet a comparison table of the common stores and their names both in the MMC and the Cert PSDrive.

Cert: Certificates MMC
My Personal
Remote Desktop Remote Desktop
Root Trusted Root Certification Authorities
CA Intermediate Certification Authorities
AuthRoot Third-Party Root Certification Authorities
TrustedPublisher Trusted Publishers
Trust Enterprise Trust
UserDS Agile Directory User Object
Selecting Certificates

When you are working with certificates y'all volition demand a way to filter and select certificates to perform specific operations against. Well-nigh of the time you lot will filter and select certificates based on the value of a specific extension.

For the following examples yous need to start by listing all installed certificates in the root CA store.

            Get-ChildItem -Path Cert:\CurrentUser\Root\          

The returned objects will be certificate objects you can use in the following examples.

Common extensions are already available as backdrop of the certificate objects. In the below example you are using Go-Member to list all the properties of the returned objects.

            Go-ChildItem -Path Cert:\CurrentUser\Root\ | Get-Member -MemberType Backdrop          
Figure 9 - The properties available for the returned certificate objects.
Figure 9 – The properties available for the returned certificate objects.

Equally you lot can see in Figure 9, some of these extensions, like Issuer, are helpful for finding the certificate yous are looking for. Extensions supply information near the certificate, such as who information technology is issued to, what it can be used for, and whatever restrictions on information technology.

In more circuitous use cases you will want to observe certificates past other extensions, like the certificate template used. The difficulty is the values for these extensions return as an array of integers. These integers correspond to ASN.1 encoded content.

The existing ScriptProperties available on the object prove examples for interfacing with these. In the below control you volition pull the Key Usages manually to see this relationship.

            ((Get-ChildItem -Path Cert:\CurrentUser\Root\ | select -First 1).Extensions | Where-Object {$_.Oid.FriendlyName -eq "Key Usage"}).format($true)          

The new piece we introduce in the above control is the format method, which performs the ASN.1 decoding. Yous pass information technology a boolean value (eastward.thou. $true) above to identify whether we want the returned object to be single-line or multi-line.

You will apply the Thumbprint value from the certificate in Figure vii in the below command. The Thumbprint value is set as a PowerShell variable and used to select the specific certificate in the beneath commands.

            $thumb = "cdd4eeae6000ac7f40c3802c171e30148030c072" Become-ChildItem -Path Cert:\CurrentUser\Root\ | Where-Object {$_.Thumbprint -eq $thumb}          

Creating Self-Signed Certificates with PowerShell

PowerShell tin can create self-signed certificates using the New-SelfSignedCertificate cmdlet. Cocky-signed certificates are useful for testing equally they let yous to generate a public and private central pair without the use of a CA.

Let'southward now create a self-signed certificate in the Current User and the Local Motorcar stores to use in examples for the adjacent steps.

In the example beneath, PowerShell is generating a public and individual key pair, a self-signed certificate, and installing them all into the appropriate certificate stores.

            PS51> New-SelfSignedCertificate -Subject 'User-Exam' -CertStoreLocation 'Cert:\CurrentUser\My' PS51> New-SelfSignedCertificate -Subject 'Computer-Test' -CertStoreLocation 'Cert:\LocalMachine\My'          

Using self-signed certificates for production services is not encouraged as all the trust-based mechanisms do not exist.

Importing/Exporting Certificates

Public key cryptography is fundamentally based on the public cardinal being widely attainable. Given this tenement you need standard ways to effectively share certificates. As as of import is security of your private keys. Storing private keys in inaccessible media, or with disaster recovery materials is a common practice for sure private keys.

Both of these require ways to store these cryptographic objects in standard formats. Exporting provides the functions to perform storing of these objects and ensure they apply widely accepted standard file formats. Importing allows you to bring the cryptographic objects into Windows operating systems.

Using the Windows Certificate Manager (certmgr.msc)

Exporting certificates from the MMC is relatively directly forward. To export a certificate without a individual key, click on the document in the MMC, click on the All Tasks menu and and then on Export.

During the export, you will be asked for a file format as shown below. The most common options are DER or Base-64 encoded.

Exporting a certificate with no private key or one that is marked as not exportable.
Effigy ten – Exporting a document with no private cardinal or 1 that is marked as not exportable.

Exporting Private Keys

To export a certificate with an associated private key, you'll have to meet two criteria; the logged-in account must take permission to the private central (for computer certificates simply) and the individual fundamental needs to be marked as exportable.

To verify the permissions for a local reckoner's private keys, y'all can select a certificate with a individual primal, choose All Tasks, and Manage Private Keys from inside the Certificates MMC. The dialog box that opens shows the access command entries for the individual keys.

The Basic Security Property Page for the private keys of a certificate with the Subject of ServerName.
The Basic Security Property Page for the private keys of a certificate with the Subject of ServerName.

When those two or three prerequisites are met you tin can select a certificate, click on All Tasks and and then on Consign just like you would with a document with only a public key. When exported, you should now take option to select Yeah, export the private key as shown beneath.

Certificate Export Wizard with exportable private key.
Certificate Export Wizard with exportable private key.

When you consign a private key in Windows you lot can simply save the file every bit a PFX. These file types and encoding formats are detailed at length in this post.

For the remaining settings shown in the export wizard, you can utilize the defaults. The below table is a quick rundown of each.

Setting Description
Including all certificates in the certification path if possible Helps with portability of certificate issuers, and includes all pertinent public keys in the PFX
Delete the individual central if the consign is successful Removes the private key from the file and has few common use cases, but ane example is to test access to individual keys
Consign all extended properties Will include whatsoever extensions within the electric current certificate, these chronicle to the certificates [specific settings]() for Windows interfaces
Enable certificate privacy Usually only the private central volition exist encrypted in the exported PFX file, this setting encrypts the entire contents of the PFX file
Group or user names You tin use a grouping or user security primary from Agile Directory for encrypting the contents of the PFX file, but a password is the most portable option across legacy systems or computers not joined to the same domain

Importing Certificates

The import part is the same for all supported certificate file types. The but departure is if the file includes a individual central you lot can "Mark this key as exportable", which you volition read more on beneath. Windows volition leverage the Document Import Wizard.

Certificate Import Wizard with a PFX file.
Effigy 12 – Certificate Import Sorcerer with a PFX file.

When you use the Certificate Import Wizard for a PFX you will need to supply the password used to encrypt the individual key. Here is another recap of the import options.

Setting Description
Enable strong private key protection Requires a countersign for each access of a individual key, be cautious of newer functions every bit they will non exist supported in all software
Marking this central equally exportable You should endeavour to avoid using this setting on any cease organization, private keys should be treated similarly to storing passwords
Protect private primal using [virtualization-based security] The setting provides more security functionality for protecting private keys from advanced malware attacks
Include all extended properties Relates to the same Windows-specific settings discussed as with exporting

PowerShell lawmaking signing certificates are a good use example for strong private key protection.

Automatic placement of certificates tin can be something of which to exist cautious. Y'all will likely have the best results manually selecting the certificate store.

Using PowerShell

At present, with PowerShell consign one of the self-signed certificates you created before. In the example the Current User is used, but you can use either.

Beneath, you are selecting a certificate in the Current User Personal logical shop that was cocky-signed, pregnant where the issuer matches the subject.

            $document = Become-Item (Become-ChildItem -Path Cert:\CurrentUser\My\ | Where-Object {$_.Subject area -eq $_.Issuer}).PSPath          

Now that yous selected a certificate, you can use the Export-Certificate command to save a DER encoded file using the control beneath.

            Export-Document -FilePath $env:USERPROFILE\Desktop\certificate.cer -Cert $certificate          

Now lets expect at exporting the private key as well. Below you are verifying that the certificate yous selected has a private key, if this does not render truthful, then the Become-Particular command probable selected the incorrect certificate.

            $certificate.HasPrivateKey          

Beneath you will prepare a password to use for encrypting the private central. Then consign the selected certificate into a PFX file and use the password you lot entered before to encrypt the file.

            $pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force Export-PfxCertificate -FilePath $env:USERPROFILE\Desktop\certificate.pfx -Password $pfxPassword -Cert $certificate          

Similarly to exporting, at that place are 2 commands. 1 command for importing certificates and one for importing PFX files.

Below the Import-Certificate command imports the DER encoded file that you exported earlier to the Electric current User's Personal shop.

            Import-Certificate -FilePath $env:USERPROFILE\Desktop\certificate.cer -CertStoreLocation Cert:\CurrentUser\My          

Let'southward say yous want to install that certificate'due south private key as well.

            $pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force Import-PfxCertificate -Exportable -Password $pfxPassword -CertStoreLocation Cert:\CurrentUser\My -FilePath $env:USERPROFILE\Desktop\certificate.pfx          

Go along in mind that the password needs to exist a Secure String. As well, if you are importing to the Local Machine store (due east.g. Cert:\LocalMachine\) you volition demand to run the command from an elevated Ambassador prompt.

In the above example, you besides use the Exportable parameter with the control, marking the private cardinal as exportable in the future. The default is to not be exportable. Exportable private keys are another security consideration, and deserves further focus on how you lot secure them.

There are also many other things to do with certificates in Windows so y'all should explore more.

Removing Certificates with PowerShell

When removing certificates yous need to keep in listen there is no Recycle Bin. In one case you delete a document, information technology's gone. This means it is critical to ostend you are deleting the right document by validating a unique identifier, like the Serial Number or Thumbprint extension value.

Similarly to above, in the below command we select a cocky-signed certificate from the Current User's Personal store.

            $document = Get-Detail (Get-ChildItem -Path Cert:\CurrentUser\My\ | Where-Object {$_.Bailiwick -eq $_.Issuer}).PSPath          

Below y'all can see the Thumbprint, Serial Number, and Bailiwick properties for the selected certificate to ensure information technology is the certificate you intend to select.

            $document.Thumbprint $certificate.SerialNumber $certificate.Subject          

Verify you accept selected the correct certificate you intend to delete.

The below command removes all selected certificate objects, please apply with caution. By passing the $certificate object through the pipeline to the Remove-Item cmdlet in the below command, you will delete all certificate content without whatsoever validation prompts.

            $certificate | Remove-Detail          

Summary

Throughout this article you have worked with certificates in Windows, learning how to access them and some tools to use when working with them. There is much more than to explore on the topic, including how to associate installed certificates with specific services, or fifty-fifty how to implement a private Public Cardinal Infrastructure (PKI) past deploying your own Certificate Authorities (CA).

Further Reading

  • Working with Certificates and IIS in Windows

Source: https://adamtheautomator.com/windows-certificate-manager/

Posted by: brottneves1942.blogspot.com

0 Response to "How To Open Certificate Manager In Windows Server 2008 R2"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel