Discussion:
can't sign assembly - "object already exists" error
(too old to reply)
jmagaram
2008-10-21 22:38:01 UTC
Permalink
I bought a code signing certificate from Comodo. I can't seem to use it for
"Sign the assembly" in Visual Studio 2008 in Vista. I get the "Error
importing key. Object already exists" error. Specific steps are shown below.
I had other problems using the "Create Test Certificate" button - access
denied error - that I "fixed" by adding myself to the permissions on
C:\Documents and Settings\All Users\Application
Data\Microsoft\Crypto\RSA\MachineKeys. I have been able to add the Comodo
pfx to the certificate store and use the signtool utility in a post-build
command, but this introduces other problems. Questions:

1. How can I use my certificate to sign code using the built-in UI of Visual
Studio?

2. Maybe my personal certificate store is somehow corrupt. Is there some way
to wipe it out and start over? Is there anything in there I really need?

3. If I'm using a certificate for assembly signing (must browse to a file to
do this) must it NOT be in the certificate store?



--

EXPORT ORIGINAL CERTIFICATE
Get code signing certificate from Comodo
From Internet Explorer Certificates configuration, export the code signing
certificate
Chose "Yes, export the private key"
Chose "PFX" format. Did NOT select ANY of these options:
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key
Delete the certificate from the certificate store

FIX CERTIFICATE WITH AT_SIGNATURE AND REIMPORT
Followed the instructions at the web address below. Specifically I used
"certutil" as provided in Visual Studio 2008 to reimport the PFX file with
"AT_SIGNATURE"
https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=1181&nav=0,7

EXPORT FIXED CERTIFICATE
Using the Certificates setting in Internet Explorer, export the certificate
Chose "Yes, export the private key"
Chose "PFX" format. Did NOT select ANY of these options:
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key as a pfx file
Delete certificate from certificate store

ATTEMPT TO SIGN ASSEMBLY
Right click on Visual Studio and choose "Run as Administrator"
In Visual Studio, right click a Project and choose Properties.
Check the box for "Sign the assembly"
Browse to the "fixed" certificate file and enter the password
ERROR - "Error importing key. Object already exists"
Gregoriusness
2008-11-05 00:24:18 UTC
Permalink
Post by jmagaram
I bought a code signing certificate from Comodo. I can't seem to use it for
"Sign the assembly" in Visual Studio 2008 in Vista. I get the "Error
importing key.Object already exists" error. Specific steps are shown below.
I had other problems using the "Create Test Certificate" button - access
denied error - that I "fixed" by adding myself to the permissions on
C:\Documents and Settings\All Users\Application
Data\Microsoft\Crypto\RSA\MachineKeys. I have been able to add the Comodo
pfx to the certificate store and use the signtool utility in a post-build
1. How can I use my certificate to sign code using the built-in UI of Visual
Studio?
2. Maybe my personal certificate store is somehow corrupt. Is there some way
to wipe it out and start over? Is there anything in there I really need?
3. If I'm using a certificate for assembly signing (must browse to a file to
do this) must it NOT be in the certificate store?
--
EXPORT ORIGINAL CERTIFICATE
Get code signing certificate from Comodo
From Internet Explorer Certificates configuration, export the code signing
certificate
Chose "Yes, export the private key"
   Include all certificates in the certification path
   Delete the private key if the export is successful
   Export all extended properties
Entered a password and file name
Finish exporting the key
Delete the certificate from the certificate store
FIX CERTIFICATE WITH AT_SIGNATURE AND REIMPORT
Followed the instructions at the web address below. Specifically I used
"certutil" as provided in Visual Studio 2008 to reimport the PFX file with
"AT_SIGNATURE"https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&...
EXPORT FIXED CERTIFICATE
Using the Certificates setting in Internet Explorer, export the certificate
Chose "Yes, export the private key"
   Include all certificates in the certification path
   Delete the private key if the export is successful
   Export all extended properties
Entered a password and file name
Finish exporting the key as a pfx file
Delete certificate from certificate store
ATTEMPT TO SIGN ASSEMBLY
Right click on Visual Studio and choose "Run as Administrator"
In Visual Studio, right click a Project and choose Properties.
Check the box for "Sign the assembly"
Browse to the "fixed" certificate file and enter the password
ERROR - "Error importing key.Object already exists"
I have exactly the same problem and would love to know what the
solution is... i've seen various bits and pieces around with people
having a similar problem, but nothing that solves it for me. :|

any suggestions?

cheers
greg
jmagaram
2008-11-27 05:42:00 UTC
Permalink
i am waiting on comodo to solve this. they haven't gotten back to me in about
a month. someone at microsoft should attempt to buy and use a comodo
certificate and then put pressure on comodo to make this work, or microsoft
should fix the bug in visual studio. there are only 3 companies that make
these types of certificates - comodo, verisign, thawte - and i think it is
inexcusable that this process doesn't work.
Post by Gregoriusness
Post by jmagaram
I bought a code signing certificate from Comodo. I can't seem to use it for
"Sign the assembly" in Visual Studio 2008 in Vista. I get the "Error
importing key.Object already exists" error. Specific steps are shown below.
I had other problems using the "Create Test Certificate" button - access
denied error - that I "fixed" by adding myself to the permissions on
C:\Documents and Settings\All Users\Application
Data\Microsoft\Crypto\RSA\MachineKeys. I have been able to add the Comodo
pfx to the certificate store and use the signtool utility in a post-build
1. How can I use my certificate to sign code using the built-in UI of Visual
Studio?
2. Maybe my personal certificate store is somehow corrupt. Is there some way
to wipe it out and start over? Is there anything in there I really need?
3. If I'm using a certificate for assembly signing (must browse to a file to
do this) must it NOT be in the certificate store?
--
EXPORT ORIGINAL CERTIFICATE
Get code signing certificate from Comodo
From Internet Explorer Certificates configuration, export the code signing
certificate
Chose "Yes, export the private key"
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key
Delete the certificate from the certificate store
FIX CERTIFICATE WITH AT_SIGNATURE AND REIMPORT
Followed the instructions at the web address below. Specifically I used
"certutil" as provided in Visual Studio 2008 to reimport the PFX file with
"AT_SIGNATURE"https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&...
EXPORT FIXED CERTIFICATE
Using the Certificates setting in Internet Explorer, export the certificate
Chose "Yes, export the private key"
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key as a pfx file
Delete certificate from certificate store
ATTEMPT TO SIGN ASSEMBLY
Right click on Visual Studio and choose "Run as Administrator"
In Visual Studio, right click a Project and choose Properties.
Check the box for "Sign the assembly"
Browse to the "fixed" certificate file and enter the password
ERROR - "Error importing key.Object already exists"
I have exactly the same problem and would love to know what the
solution is... i've seen various bits and pieces around with people
having a similar problem, but nothing that solves it for me. :|
any suggestions?
cheers
greg
Muruganandam
2009-01-09 13:19:14 UTC
Permalink
guys,

please go through the below link from comodo and let us know
https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=1181&nav=0,7
Post by jmagaram
i am waiting on comodo to solve this. they haven't gotten back to me in about
a month. someone at microsoft should attempt to buy and use a comodo
certificate and then put pressure on comodo to make this work, or microsoft
should fix the bug in visual studio. there are only 3 companies that make
these types of certificates - comodo, verisign, thawte - and i think it is
inexcusable that this process doesn't work.
Post by Gregoriusness
Post by jmagaram
I bought a code signing certificate from Comodo. I can't seem to use it for
"Sign the assembly" in Visual Studio 2008 in Vista. I get the "Error
importing key.Object already exists" error. Specific steps are shown below.
I had other problems using the "Create Test Certificate" button - access
denied error - that I "fixed" by adding myself to the permissions on
C:\Documents and Settings\All Users\Application
Data\Microsoft\Crypto\RSA\MachineKeys. I have been able to add the Comodo
pfx to the certificate store and use the signtool utility in a post-build
1. How can I use my certificate to sign code using the built-in UI of Visual
Studio?
2. Maybe my personal certificate store is somehow corrupt. Is there some way
to wipe it out and start over? Is there anything in there I really need?
3. If I'm using a certificate for assembly signing (must browse to a file to
do this) must it NOT be in the certificate store?
--
EXPORT ORIGINAL CERTIFICATE
Get code signing certificate from Comodo
From Internet Explorer Certificates configuration, export the code signing
certificate
Chose "Yes, export the private key"
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key
Delete the certificate from the certificate store
FIX CERTIFICATE WITH AT_SIGNATURE AND REIMPORT
Followed the instructions at the web address below. Specifically I used
"certutil" as provided in Visual Studio 2008 to reimport the PFX file with
"AT_SIGNATURE"https://support.comodo.com/index.php?_m=knowledgebase&_a=viewarticle&...
EXPORT FIXED CERTIFICATE
Using the Certificates setting in Internet Explorer, export the certificate
Chose "Yes, export the private key"
Include all certificates in the certification path
Delete the private key if the export is successful
Export all extended properties
Entered a password and file name
Finish exporting the key as a pfx file
Delete certificate from certificate store
ATTEMPT TO SIGN ASSEMBLY
Right click on Visual Studio and choose "Run as Administrator"
In Visual Studio, right click a Project and choose Properties.
Check the box for "Sign the assembly"
Browse to the "fixed" certificate file and enter the password
ERROR - "Error importing key.Object already exists"
I have exactly the same problem and would love to know what the
solution is... i've seen various bits and pieces around with people
having a similar problem, but nothing that solves it for me. :|
any suggestions?
cheers
greg
nige
2009-01-09 14:17:00 UTC
Permalink
I have the same problem. Comodo are fast to respond but non of the
instructions on the help pages work. VS just refuses to sign the assemblies.
You can use the exact same pfx file to sign the click once manifests without
any problems so why it should work for that and not for the assemblies is
beyond me.

Is there please anyone out there that has exported a Comodo cert as a pfx
and signed the assemblies in Visual Studio??
nige
2009-01-12 16:42:00 UTC
Permalink
Install openssl, http://www.openssl.org/related/binaries.html is where is the
installation download is hidden away under sofa.

- > openssl pkcs12 -in MY_PFX_FILE.pfx -out BACKUP_PFX_FILENAME.key -- This
protects you from overwriting the current PFX.

- > openssl pkcs12 -export -out MY_NEW_PFX_FILE.pfx -keysig -in
BACKUP_PFX_FILENAME.key --Mark PFX for Key Signing.

This makes a new cert that does not produce the error. In my case the
assemblies still don't get signed though :(

I hope thats of help to someone!

Loading...