Posted By: Simo | Jul 21st, 2004 @ 12:33 AM
page 1 of 1
Comments: 7 | Views: 7499
Simo
Simo
With me it's a full-time job.
I'm trying to figure out how to generate my own Software Publisher Certificate using Certificate Services on my own Windows 2003 server. Can anyone help guide me through this?

This one appears to be a toughie. Being a fully paid up MSDN universal subscriber I originaly posted the question in a 'managed' MSDN news group.

I got one reply from MS telling me to "Just enroll for a 'code signing' certificate using that template." If I was standing in front of the guy I would have slapped him.

My goal is to generate spc and pvk files that I can then go and sign my own macro code.

The background is:
I'm the single developer in a small office. I write a lot of .net code used with Excel and I need to get rid of the annoying "Enable Macros" buttons from our own code.

I know I could purchase an SPC from verisign, etc but this seems pointless for my situation as the only people that will be using this code is ourselves and we trust ourselves.

Anyone done this before?

Anyone needing a good laugh at the offical reply from Microsoft can look here
http://msdn.microsoft.com/newsgroups/managed/default.aspx?pg=2&lang=en&cr=US&guid=&dg=microsoft.public.platformsdk.security&fltr=

thread posted on 15th July, subject: Generating my own Software Publishing Certificate
Hi Simo


Have you already set up certificate services on a machine. I'm assuming you have in the following...let me know if not...

If so you should be able to browse to http://localhost/certsrv on the machine with certificate services installed.

assuming this works then follow the wizard on that page:
the personal info can be whatever...
Choose code signing cert in the certificate type combo
Choose a suitable CSP and key length ( 2048 ms rsa/aes enhanced provider maybe? )
mark the keys as exportable via the checkbox and strongly protect the private keys.

request format shouldn't matter. sha512 it if u are paranoid...

Hit submit and you should get a pending request page

Now you have to play the role of the certserver and accept the certificate request.

So run the certificate services mmc snapin on the same machine( start, run, certsrv.msc )

there should be a tab underneath your CA that says pending requests. Go to this and right hand mouse on the cert that's ( hopefully ) there and click issue..

the cert is now issued. One last step...

Browse back to http://localhost/certsrv and click on the link that says "view the status of a pending request". Click on the cert there and click download. This will give you a valid cert that u can use for code signing...

Let me know if that's enough info to go on...it is kind of long winded, but ok once you've been through it once... Smiley


edit:
you can gen spc files from an exported .cer cert using this utility
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfsoftwarepublishercertificatetesttoolcert2spcexe.asp


That's strange. I just re-set up a cert server on one of my boxes to confirm that what i said worked, and it gives me all the choices on a fresh install also..

Are you an admin on the box? Is this a root standalone CA that you've installed...this is all Windows 2003 right?

if you go to http://localhost/certsrv hit "request a certificate", hit "advanced certificate request", hit "create and submit a request to this CA" do you only get the two choices in the certificate type dropdown box? There should be about 7 or 8 there...


cool, we're getting close though.

Could you try these settings in the cert request web-page please. i get a .pvk etc successfully from this:

Type of cert needed:
   code signing cert

Key Option:
   Create new keyset checked
   CSP: Microsoft enhanced RSA and AES Crypto provider ( should be the bottom option )
   KeyUsage: signature
   KeySize: 2048 ( or 4096 )
   Check automatic key container name
   check - mark keys as exportable ( somethign is badly wrong if this is greyed out )
   check - export keys to file ( give the .pvk file )
   check - enable strong key protection

Additional Options:
   Request format: cmc
   hash algo: sha1
 
not sure what's wrong if this doesnt work but let me know and we can try a couple of other things...

It looks like your cert wasn't correctly issued btw. Did it show up in the issued section in the certsrv.msc mmc snapin?

I would expect "view the status of pending request" to have the cert there after it was issued, so maybe its worth checking it really is issued?

"download a ca cert" isnt what you need btw, it's for download the cert of another certificate authority, and for updating cert revocation lists etc.



page 1 of 1
Comments: 7 | Views: 7499
Microsoft Communities