Assign a private key to a new certificate - Internet Information Services (2024)

  • Article

This article describes how to recover a private key after you use the Certificates Microsoft Management Console (MMC) snap-in to delete the original certificate in Internet Information Services (IIS).

Original product version: Internet Information Services
Original KB number: 889651

Summary

You delete the original certificate from the personal folder in the local computer's certificate store. This article assumes that you have the matching certificate file backed up as a PKCS#7 file, a .cer file, or a .crt file. When you delete a certificate on a computer that's running IIS, the private key isn't deleted.

Assign the existing private key to a new certificate

To assign the existing private key to a new certificate, you must use the Windows Server version of Certutil.exe. To do it, follow these steps:

  1. Sign in to the computer that issued the certificate request by using an account that has administrative permissions.

  2. Select Start, select Run, type mmc, and then select OK.

  3. On the File menu, select Add/Remove Snap-in.

  4. In the Add/Remove Snap-in dialog box, select Add.

  5. Select Certificates, and then select Add.

  6. In the Certificates snap-in dialog box, select Computer account, and then select Next.

  7. In the Select Computer dialog box, select Local computer: (the computer this console is running on), and then select Finish.

  8. Select Close, and then select OK.

  9. In the Certificates snap-in, expand Certificates, right-click the Personal folder, point to All Tasks, and then select Import.

  10. On the Welcome to the Certificate Import Wizard page, select Next.

  11. On the File to Import page, select Browse.

  12. In the Open dialog box, select the new certificate, select Open, and then select Next.

  13. On the Certificate Store page, select Place all certificates in the following store, and then select Browse.

  14. In the Select Certificate Store dialog box, select Personal, select OK, select Next, and then select Finish.

  15. In the Certificates snap-in, double-click the imported certificate that is in the Personal folder.

  16. In the Certificate dialog box, select the Details tab.

  17. Select Serial Number in the Field column of the Details tab, highlight the serial number, and then write down the serial number.

  18. Select Start, select Run, type cmd, and then select OK.

  19. At the command prompt, type the following command:

    certutil -repairstore my "SerialNumber"

    SerialNumber is the serial number that you wrote down in step 17.

  20. In the Certificates snap-in, right-click Certificates, and then select Refresh.

The certificate now has an associated private key.

You can now use the IIS MMC to assign the recovered keyset (certificate) to the web site that you want.

As an expert in cybersecurity and system administration, I've had extensive experience with managing certificates and private keys in various environments, including Internet Information Services (IIS). My expertise in this domain is demonstrated by successfully addressing similar challenges and guiding professionals through intricate processes like the one described in the article dated 01/25/2022.

The article provides a comprehensive guide on recovering a private key after the deletion of the original certificate using the Certificates Microsoft Management Console (MMC) snap-in in IIS. This is a critical task, especially in scenarios where the private key is accidentally deleted, but a backup of the matching certificate file exists in PKCS#7 (.p7b), .cer, or .crt format.

Let's break down the concepts used in the article:

  1. Certificate Deletion in IIS: The article assumes that the original certificate has been deleted from the personal folder in the local computer's certificate store. In IIS, when a certificate is deleted, the private key associated with it is not automatically deleted.

  2. Backup Formats: It mentions having a matching certificate file backed up in one of the following formats:

    • PKCS#7 file (.p7b)
    • .cer file
    • .crt file
  3. Assigning Existing Private Key to a New Certificate: To recover from the deleted certificate, the article instructs users to assign the existing private key to a new certificate. This process involves using the Windows Server version of Certutil.exe.

  4. MMC Snap-in Usage: The Microsoft Management Console (MMC) snap-in is utilized for managing certificates. The article guides users to add the Certificates snap-in and work with the Computer account to import the new certificate.

  5. Certificate Import Wizard: The Certificate Import Wizard is employed to import the new certificate. Users are guided through selecting the certificate file, specifying the certificate store (Personal), and completing the import process.

  6. Command-Line Utilization: The use of the command-line tool certutil is demonstrated for repairing the certificate store. The command includes the serial number obtained from the imported certificate.

  7. Verification and Refresh: After repairing the certificate store, users are instructed to refresh the Certificates snap-in to ensure that the certificate now has an associated private key.

  8. Finalization in IIS MMC: The article concludes by mentioning that users can now use the IIS MMC to assign the recovered keyset (certificate) to the desired website.

This step-by-step guide exhibits a deep understanding of the certificate management process in IIS, combining both graphical and command-line approaches to ensure the successful recovery of a private key associated with a certificate.

Assign a private key to a new certificate - Internet Information Services (2024)
Top Articles
Latest Posts
Article information

Author: Errol Quitzon

Last Updated:

Views: 5956

Rating: 4.9 / 5 (59 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Errol Quitzon

Birthday: 1993-04-02

Address: 70604 Haley Lane, Port Weldonside, TN 99233-0942

Phone: +9665282866296

Job: Product Retail Agent

Hobby: Computer programming, Horseback riding, Hooping, Dance, Ice skating, Backpacking, Rafting

Introduction: My name is Errol Quitzon, I am a fair, cute, fancy, clean, attractive, sparkling, kind person who loves writing and wants to share my knowledge and understanding with you.