|
Visual Studio 2005 error 'Cannot find the
certificate and private key for decryption'
Assembly Signing Using
Visual Studio Project Designer's
Problem : The .pfx file cannot include certificate chaining
information. (If the .pfx file does include this information, the
following import error will occur: "Cannot find the certificate and
private key for decryption.")
Resolution : The most common problem arises when using a .pfx file that
contains chaining information. You can remove chaining information from
the key file by running the Certificate Manager snap-in (Certmgr.msc),
importing the pfx file into the personal certificate store, and then
exporting it without including the certificate chain information. You
can accomplish this by doing the following:
-
On the Start menu,
click Run, type mmc, and then click OK. The Console1 dialog box
appears.
-
On the File menu,
click Add/Remove Snap-in. The Add/Remove Snap-in dialog box appears.
-
Click Add. The Add
Standalone Snap-in dialog box appears.
-
Click Certificates,
and then click Add. The Certificates snap-in dialog box appears.
-
Select My User account,
click Finish, click Close, and then click OK to close the dialog
boxes.
-
Expand Certificates -
Current User, expand Personal and then expand Certificates.
-
Right click on the
Certificates node and from the context menu select All Tasks and
Import.
-
The Certificate Import
Wizard appears; click Next.
-
At the File to Import
step, browse and select the .pfx file and then click Next.
-
Enter private key
password information, check the option to mark this key as
exportable, and then click Next.
-
At the Certificate
Store step, go with the defaults to place into the Personal
Certificate store, click Next, and then click Finish.
-
The certificate is now
imported and ready for export. Select and right click on this
certificate and, from the context menu, select All Tasks and Export.
-
The Certificate Export
Wizard dialog appears; click Next.
-
At the Export Private
Key step, select the option Yes to export the private key and then
click Next.
-
At the Export File
Format step, make sure the option to include all certificates in the
certificate path is unchecked and click Next.
-
At the Password step,
enter desired password information and click Next.
-
At the File to Export
step, specify the file name, click Next, and then click Finish.
-
This should display
the export was successful dialog; click OK.
For more information
please see the
Microsoft Article |