Combine A Private Key With .p7b Certificate file (How to Create a .pfx File)

This article will show you how to combine a private key with a .p7b certificate file to create a .pfx file on Windows Internet Information Server (IIS).

To correct this, you will:

  1. Import the certificate into the personal store using Microsoft Management Console (MMC)
  2. Export the corrected certificate


Importing the Certificate with MMC

1. Open MMC on your computer (you can locate this program by typing “mmc” in your Windows search bar).

IIS7_No_Private_Key_Error_fix_01

2. Select “File > Add/Remove Snap-in” (or type Control-M). Select “Certificates” and click the Add button.

IIS7_No_Private_Key_Error_fix_02

3. Select “Computer account” and click Next

IIS7_No_Private_Key_Error_fix_03_1

…then direct the snap-in to manage the “Local computer” and click Finish.

IIS7_No_Private_Key_Error_fix_03_2

4. Click OK to add the snap-in.

5. Next, navigate to the “Certificates (Local Computer) > Personal > Certificates” folder.

IIS7_No_Private_Key_Error_fix_05_1

6. Right-click the folder and select “All tasks > Import” from the menu to open the Certificate Import Wizard.

IIS7_No_Private_Key_Error_fix_06_1

7. In the Import Wizard, make sure “Local Machine” is selected and hit Next.

IIS7_No_Private_Key_Error_fix_07_1

8. Locate and designate the target certificate (it should be in the .p7b format), then press Next.

IIS7_No_Private_Key_Error_fix_08_21

9. Set the wizard to place the imported certificates in the “Personal” store. Hit Next to proceed.

IIS7_No_Private_Key_Error_fix_09

10. Check the settings, then click Finish to import the certificate.

IIS7_No_Private_Key_Error_fix_10_11_12.


Export the Corrected Certificate

11. Right-click the certificate and select “All tasks > Export” to open the Certificate Export Wizard.

IIS7_No_Private_Key_Error_fix_16

12. After clicking through the Wizard’s welcome page, make sure that the option is set to “Yes, export the private key” and click Next.

IIS7_No_Private_Key_Error_fix_17_1

13. Choose the format for the exported certificate (here, a PKCS # 12 -encoded, or .PFX file). Make sure to check the boxes to include all certificates in the path and to export all extended properties, then click Next.

IIS7_No_Private_Key_Error_fix_18_1

14. You will be prompted for a password to protect this certificate bundle (a good idea, since it incorporates your private key). Create and confirm your password, then click Next.

IIS7_No_Private_Key_Error_fix_19_1

15.  Select the name and location of the file you are exporting. You may browse to a location you prefer – make sure to save the file with the .pfx extension.

Note: Including the date is a good way to differentiate this certificate file from other ones.

IIS7_No_Private_Key_Error_fix_20_1

16. Review the information. If this all looks correct, click Finish.

IIS7_No_Private_Key_Error_fix_21_1

You will receive confirmation that the export was successful.

IIS7_No_Private_Key_Error_fix_22