vcsjones / AzureSignTool

SignTool Library and Azure Key Vault Support
MIT License
267 stars 85 forks source link
authenticode azure azure-key-vault signersignex3

Azure Sign Tool

The below README is based on functionality in main which may not be the same as the latest released version of AzureSignTool. For README information about released versions, please see the README for the version's associated tag. The README for the current release can be found here.

Azure Sign Tool is similar to signtool in the Windows SDK, with the major difference being that it uses Azure Key Vault for performing the signing process. The usage is like signtool, except with a limited set of options for signing and options for authenticating to Azure Key Vault.

Example usage:

AzureSignTool.exe sign -du "https://vcsjones.com" \
  -fd sha384 -kvu https://my-vault.vault.azure.net \
  -kvi 01234567-abcd-ef012-0000-0123456789ab \
  -kvt 01234567-abcd-ef012-0000-0123456789ab \
  -kvs <token> \
  -kvc my-key-name \
  -tr http://timestamp.digicert.com \
  -td sha384 \
  -v \
  -ifl C:\list\of\file\to\sign.txt \
  C:\additional\file\to\sign\program1.exe \
  C:\additional\file\to\sign\program2.exe

The --help or sign --help option provides more detail about each parameter.

A walk-through is available if you're interested on getting set up from scratch.

Parameters

Advanced

In most circumances, using the defaults for page hashing is recommended, which can be done by simply omitting both of the parameters.

Supported Formats

This tool uses the same mechanisms for signing as the Windows SDK signtool. It will support the same formats as signtool supports. However, the formats that azuresigntool and signtool support vary by operating system and which Subject Interface Packages are present on the system.

Exit Codes

The exit code is an HRESULT. Successfully signing produces a result of S_OK ("0"). If all files fail to sign, the exit code is 0xA0000002. If some were signed successfully, the exit code is 0x20000001.

Cancellation

The standard Ctrl+C key sequence is used to cancel the signing. Any in-flight signing operations are finished, then the process exits with a status code according to the complete signing operations.

Requirements

Windows 10 or Windows Server 2016 is required. Some features require later versions of Windows.