views:

306

answers:

2

I'd like to generate a certificate for development purpose but, I don't want to install the certificate in the store.

makecert with the switch -pe doesn't create the private key if you specify an output file an output file. I tried to create a .pfx file by exporting the certificate created with makecert, it asks me a password to protect the private key, I guess I can't use it with my WCF service since the config file has no information about the password...

Why in the hell is it so complicated ? Do you know a simple tool to create a certificate with private key inside a file without password in one simple step ?

Thanks,

A: 

Visual Studio - using MakeCert:

MSDN Article

Dani
As I said, I didn't manage to create a certificate with the private key inside in a file with MakeCert, because it cant, you're obliged to store the certificate and private key in the store, and I don't want all this pain.
Nicolas Dorier
no you don't... you can export it with the key.
Dani
although it will be 2 actions and not one....
Dani
In fact, the private key can only be exported in a different file, after you need pvk2pfx.exe to "merge" public and private key in a pfx file, I've shared the command line with my response.
Nicolas Dorier
A: 
makecert -r -pe -n "CN=CompanyXYZ Server" -b 01/01/2007 -e 01/01/2010 -sky exchange Server.cer -sv Server.pvk
pvk2pfx.exe -pvk Server.pvk -spc Server.cer -pfx Server.pfx

from here.

Nicolas Dorier