What to do with the code signing certificate?
code-signing, wpf
Solution
This is actually rather easy to do.
The Solution
ON THE SAME MACHINE THAT WAS USED TO ORDER THE NEW CERTIFICATE, right-click the .cer file and install it.
Next, go to the same browser that was used when ordering the certificate, and export the certificate.
- On IE, go Menu (gear icon) -> Internet Options -> Content. Select the certificate and click "Export...".
- On Chrome, go Menu (3 bars) -> Settings -> Advanced -> Manage certificates. Select the certificate and click "Export...".
- On Firefox, go Firefox (drop-down menu) -> Options -> Options -> Advanced -> Encryption -> View Certificates. Select the certificate and click "Backup...".
Follow the wizard to export the certificate to a file. MAKE SURE YOU SELECT "Yes, export the private key". Use the "Personal Information Exchange - PKCS #12 (.PFX)" option, and select the "Include all certificates in the certification path if possible" and "Export all extended properties" checkboxes.
You will now have a .PFX or a .P12 file you can distribute to your developers.
The Details
Obtaining a certificate involves creating a CSR (Certificate Signing Request). This process creates your PK (Private Key), and stores it in that computer's certificate store. It also creates the actual CSR, which your CA (Certificate Authority, or the company issuing your certificate) needs to generate your code-signing certificate. The neat thing is, the CSR DOES NOT contain your private key, so your CA never, ever gets their hands on the PK.
Your CA uses the CSR to generate your cryptographically secure certificate. Because they don't have your PK, they can't create a .PFX file. They can only create a .CER. By installing the .CER file on the same machine that generated the CSR, the certificate store will automatically match the CSR and associated PK with the .CER fingerprint. Once the certificate is installed, you can then export the certificate and PK as a single .PFX.
Problem
My company ordered a code signing certificate from Symantec and I was given the task to use it. I have no idea how to do that and there are no clear instructions even on their website. I have a certificate in .cer format and when I try to use it from Visual studio 2013 - properties window it is saying that the certificate doesn't have a private key associated with it. I searched and found that the .pvk file will be stored in the system registry from which we have ordered the certificate. Given I can get the .pvk file I want to know what to do next. I have two files and I need a .pfx format(which contains a private key). I know this is not exactly a programming question but I hope somebody had the same problem like me and they can guide me. I am working on a WPF application.