Archive for February, 2008

Create a self signed - code signing certificate

Wednesday, February 6th, 2008

Using “makecert.exe”, whic is a part of Windows SDK, or download it here.
This tool is suitable for testing purposes only!

To create the root certificate:
Open Windows SDK CMD Shell (or Command Prompt and go to the makecert.exe location)
Run this command
makecert -n “CN=PowerShell Root Certificate” -a sha1 -eku 1.3.6.1.5.5.7.3.3 -r -sv root.pvk root.cer -ss Root -len 1024 -sr localMachine

To create a user certificate (with the private key):
Open Windows SDK CMD Shell (or Command Prompt and go to the makecert.exe location)
Run this command

makecert -pe -n “CN=PowerShell User Certificate” -ss MY -a sha1 -eku 1.3.6.1.5.5.7.3.3 -iv root.pvk -ic root.cer

Note that the number 1.3.6.1.5.5.7.3.3 indicates that a certificate can be used for code signing.

More info for Makecert: http://msdn2.microsoft.com/en-us/library/aa386968(VS.85).aspx