There are professional services which cost $300-$900 per year that are already trusted. If you make yourself a trusted person, then its free!
You need 3 programs (4 if you are making drivers):
MakeCert which makes the root private certificate and private key
pvk2pfx which combines the two above items into PFX file
SignTool which actually signs the program using the certificate you made above
(for drivers you also need inf2cat because inf files cannot be signed directly)
All of these programs are found in the bin directory of the Windows SDK (which can be downloaded freely at
Download details: Microsoft Windows 7 SDK). You may want CertMgr from the SDK.
Looking back at my batch files, this is the basic outline of how to sign a program. It may need some adjusting, but its a good starting point. Pick a value for XXX and keep it the same throughout:
- Do the following once:
- MakeCert -r -n "CN=My Company Name" -pe -sv XXX.pvk -ss XXXCertStore XXX.cer
- pvk2pfx -pvk XXX.pvk -pi MyPassword -spc XXX.cer -pfx XXX.pfx -f
- Do the following per computer that is using SignTool (probably only one):
- Double Click XXX.pfx to install it, let the program pick the store, you will need to enter MyPassword
- Do the following per program, every time you make a change:
- Do the following once on each target computer (you won't have to do this again if you re-sign the file and only once no matter how many different files you changed):
- Easy method: certutil -addstore ROOT XXX.cer (note: certutil is in system32 on all Windows machines)
- Harder method (but doesn't require XXX.cer):
- Right click "SignedFile.exe", choose "Properties"
- Click "Digital Signatures" tab
- Click on the signature then "Details"
- It will say something is wrong with the signature
- Click "View Certificate"
- Click "Install Certificate..."
- Click "Next >"
- Some special steps are probably required for this current project:
- Choose "Place all certificates in the following store" and choose "Browse..."
- Click "Show physical stores"
- Choose "Trusted Root Certificate Authorities" -> "Local Computer"
- Click "Okay"
- Click "Next >" and "Finish"
- At the security warning click "Yes"
- Close all the windows
- Note: All of the above steps can probably be accomplished with a REG file (look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SystemCertificates\Root\Certificates before and after adding it)
- Second Note: To see that it worked, view the signature again (the first three steps, it should say its OK).
So one issue that may come up is that the files are already signed. We will probably have to find a way to remove that signature. Also, even though we are storing this certificate in the Trusted Root CA for the entire computer, who knows if it will work for boot-time programs.
Also, when modifying ANY exe or dll, make sure to update the PE checksum. During verification this is checked before the signature is checked. Your resource modifying tool may do this for you, maybe not. Check out
Coder for Life - Projects - Win 7 Customizer Tools
I will try this out later today. I have a machine solely used for testing this kind of stuff.