Command line tool to automate Microsoft’s SignCode tool (prevents the password dialog popping up).
|Download:||signcode-pwd_1.02.zip (53 KB · Version History)|
|Operating System:||Windows NT 4, 2000, XP, 2003 or newer|
Microsoft has a tool called SignCode to sign any file using a private/public key algorithm. This files can later be verified with Windows APIs. The Internet Explorer also makes use of this possibility when it wants to start ActiveX controls.
Most people use SignCode as a command line tool. This lets them create a batch (.bat) file to do the signing, and maybe include the batch as a post-build step in their development environment. The only problem is that SignCode doesn’t let you supply the certificate password as part of the command line, so it always hassles you with a little password dialog.
To avoid the dialog popping up, I wrote a small command line tool, called signcode-pwd. You start this tool right before SignCode. As parameter you provide the password you want to be filled in the password dialog. signcode-pwd watches the windows processes running and if it finds the SignCode password dialog it automatically completes it. If there are a series of dialogs popping up it all completes them. If the signing process is finished, terminate signcode-pwd.
If you dont want to pass your password as parameter to signcode-pwd, you also can encrypt it and put it into a file. See following screenshot for all provided functions:
Example of how you use signcode-pwd (this could be a post build step):
signcode-pwd.exe -m Xyz089e
SignCode.exe -spc Cert.spc -v My.pvk -t http://timestamp.verisign.com/scripts/timstamp.dll MyFile.exe
It’s best to write a batch file, which takes as parameter the file which has to be signed and does the whole signing process. An example batch file is included in the download. It looks like this:
rem TODO: Modify this constants before using
echo Start signcode-pwd.exe
%strSignCodePwd% -f %strPwd%
echo Execute signcode.exe
%strSignCode% %strFile% -spc %strSpc% -v %strPvk% -t %tsUrl%
if errorlevel 0 goto end_success
echo Error occured while signing
echo Signing was successfull