Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2012 Signing Assembly Error - "Cannot find the certificate..."

I'm trying to sign my app in VS2012 but I'm receiving "Cannot find the certificate and private key for decryption" error.

What I do:

  1. I received my certificate by Comodo CA Limited in Google Chrome.
  2. Exported the certificate to a file with "Include all certificates" and "Export private key" options.
  3. In VS2012, Signing tab I browse to the certificate file and fill in the password. The "Cannot find..." error appear.

I also tried all steps in this tutorial: Visual Studio error 'Cannot find... in Comodo Knowledge Base, but no success.

The same key works fine when signing with the Comodo kSign tool and also when using signtool.exe

....

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.

Importing the certificate in MMC and exporting again doesn't help

...

I tried it on other machine, but the same problem. Any ideas?

like image 292
Miroslav Popov Avatar asked Apr 05 '14 15:04

Miroslav Popov


1 Answers

https://msdn.microsoft.com/en-us/library/aa730868%28vs.80%29.aspx#rsvssign_topic3

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.")

Just do not set "Include all certificates" while exporting the *.pfx file

like image 189
name1ess0ne Avatar answered Nov 01 '22 13:11

name1ess0ne