{"id":260,"date":"2016-01-19T14:08:31","date_gmt":"2016-01-19T14:08:31","guid":{"rendered":"http:\/\/www.pkipartner.support\/?page_id=260"},"modified":"2016-01-28T10:13:04","modified_gmt":"2016-01-28T10:13:04","slug":"codesign-object-already-exists-error-in-visual-studio-20052008","status":"publish","type":"page","link":"https:\/\/pkipartner.com\/support\/codesign-object-already-exists-error-in-visual-studio-20052008\/","title":{"rendered":"Codesign &#8211; Object Already Exists error in Visual Studio 2005\/2008"},"content":{"rendered":"<h1>Object Already Exists error in Visual Studio 2005\/2008<\/h1>\n<h4>Changing from AT_KEYEXCHANGE (1) to AT_SIGNATURE (2)<\/h4>\n<p>Using CertUitl from Windows Server 2003 SP1 or later you can force KeySpec to match your wishes\/needs when importing a PFX (aka PKCS#12) file.<br \/>\nThe steps to follow are:<\/p>\n<p>Using the &#8220;Certifiates&#8221; MMC export the existing keyset (KeySpec=1) to a PFX file.<br \/>\nNote: Please backup this file to a safe location and test if the file can be imported ok on another machine before moving on to the next step.<\/p>\n<p>Delete the existing certificate from the crypto store (stlll using the MMC).<\/p>\n<p>Open up a command prompt (CMD.exe)<\/p>\n<p>Import the PFX file using this command:<br \/>\n<strong>-&gt; certutil -importPFX -user &#8220;pfxfilename&#8221; AT_SIGNATURE <\/strong><\/p>\n<p>Enter the passphrase for the pfx when prompted.<\/p>\n<p>You now should have a keyset\/Cert with KeySpec=2. If needed you can now export this into another PFX file using the MMC again.<\/p>\n<p>Alternatively if the above does not work you can use <a href=\"http:\/\/www.openssl.org\/\">OpenSSL<\/a> and explicitly set the the PFX for key signing.<\/p>\n<p>&#8211; &gt; openssl pkcs12 -export -out MY_PFX_FILE.pfx -keysig -inkey Key.pvk -in mycert.spc &#8212; Only if you have the SPC and PVK files.<\/p>\n<p>&#8211; or &#8211;<\/p>\n<p>&#8211; &gt; openssl pkcs12 -in MY_PFX_FILE.pfx -out BACKUP_PFX_FILENAME.key &#8212; This protects you from overwriting the current PFX.<br \/>\n&#8211; &gt; openssl pkcs12 -export -out MY_NEW_PFX_FILE.pfx -keysig -in BACKUP_PFX_FILENAME.key &#8211;Mark PFX for Key Signing.<\/p>\n<p>Related Links:<br \/>\n* <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?FamilyID=86b71a4f-4122-44af-be79-3f101e533d95&amp;displaylang=en\">Windows Server 2003 Service Pack 2 Administration Tools Pack for x86 editions<\/a> (XP\/Server 2003)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Object Already Exists error in Visual Studio 2005\/2008 Changing from AT_KEYEXCHANGE (1) to AT_SIGNATURE (2) Using CertUitl from Windows Server 2003 SP1 or later you can force KeySpec to match your wishes\/needs when importing a PFX (aka PKCS#12) file. The steps to follow are: Using the &#8220;Certifiates&#8221; MMC export the\u2026<\/p>\n<p> <a class=\"continue-reading-link\" href=\"https:\/\/pkipartner.com\/support\/codesign-object-already-exists-error-in-visual-studio-20052008\/\"><span>Continue reading<\/span><i class=\"crycon-right-dir\"><\/i><\/a> <\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/pages\/260"}],"collection":[{"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":2,"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/pages\/260\/revisions"}],"predecessor-version":[{"id":588,"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/pages\/260\/revisions\/588"}],"wp:attachment":[{"href":"https:\/\/pkipartner.com\/support\/wp-json\/wp\/v2\/media?parent=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}