This last step is the one you will perform most often. It requires two files:
Use this command to sign the file HelloWord.exe
signtool sign /debug /fd sha256 /f code_signing.pfx /tr http://timestamp.digicert.com /td sha256 HelloWord.exe
Note: The original HelloWord.exe
file is overwritten with its signed version.
/tr http://timestamp.digicert.com
is important. It returns a certified timestamp that will be included with the signature.
This allows the signature to be accepted even after the certificate included in code_signing.pfx
has expired.
These url can also be used:
• http://time.certum.pl
• http://timestamp.sectigo.com
• http://timestamp.globalsign.com/scripts/timstamp.dll
👉 To avoid being banned, space out your requests by approximately 15 seconds ;-)
🕮 Manual for signtool sign
Right click on the signed file (HelloWord.exe
) > click on ‘Properties’ > click on the ‘Digital Signatures’ tab
If you click on the ‘Advanced’ tab you can see who is the ‘Issuer’: you as a CA.
DO NOT click on ‘Install Certificate’.
Now, as a user of your software, install the private CA certificate myRootCA.crt
published by MY-ORG
(as explained here) and check again the Digital Signatures of HelloWord.exe
. You should get this:
Click on ‘View Certificate’
DO NOT click on ‘Install Certificate’.
Click on the ‘Certification Path’ tab
if this verification was successful, this means:
myRootCA.crt
) is valid 🡆 It can be publishedcode_signing.pfx
) is valid 🡆 It must stay secretUsers of your signed files will have to import the myRootCA.crt
file into their Windows key store.
You must therefore publish myRootCA.crt
and its thumbprint .
See last paragraph of step 1 for more details.