Skip to content

Instantly share code, notes, and snippets.

@christianhelle
Last active July 3, 2018 07:51
Show Gist options
  • Save christianhelle/864a4a50250b8290bca3dee7f5d7e0d1 to your computer and use it in GitHub Desktop.
Save christianhelle/864a4a50250b8290bca3dee7f5d7e0d1 to your computer and use it in GitHub Desktop.

Code Signing

Command line

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe" sign /f "[pfx file]" /p "[private key password]" /tr [time stamp server url] /td SHA256 "[path to assembly]"

Post build event Visual Studio Project

if $(ConfigurationName) == Release $(SolutionDir)..\Certificates\signtool.exe sign /f $(SolutionDir)..\[Certificate Directory]\[pfx file].pfx /p "[private key password]" /tr [time stamp server url]  /td SHA256 $(TargetDir)*.exe
if $(ConfigurationName) == Release $(SolutionDir)..\Certificates\signtool.exe sign /f $(SolutionDir)..\[Certificate Directory]\[pfx file].pfx /p "[private key password]" /tr [time stamp server url]  /td SHA256 $(TargetDir)*.dll

Post build event for Visual Studio Setup project

$(ProjectDir)..\..\Certificates\signtool.exe sign /f $(ProjectDir)..\..\[Certificate Directory]\[pfx file].pfx /p "[private key password]" /tr [time stamp server url] /td SHA256 $(BuiltOuputPath)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment