MS

SignTool

Overview

The SignTool utility digitally signs files, verifies signatures, and timestamps signed files. It is part of the Windows SDK and is commonly used in build pipelines for Windows applications, drivers, and installers.

Command-line Syntax

signtool [options] command [command-options] [files]

Common commands include sign, verify, timestamp, and remove.

Options

OptionDescription
/aAutomatically selects the best signing certificate.
/f FileSpecifies a certificate file (PFX) to use.
/p PasswordPassword for the certificate file.
/tr URLTimestamp server URL (RFC 3161). Example: https://timestamp.digicert.com
/td AlgorithmDigest algorithm for the timestamp (SHA256, SHA1).
/vVerbose output.
/t URLLegacy timestamp server URL.
/d DescriptionSpecifies the file description.
/du URLSpecifies a URL for the description.
/s StoreNameCertificate store name (e.g., My).
/sha1 ThumbprintSelects a certificate by its SHA‑1 thumbprint.
/csp ProviderSpecifies a cryptographic service provider.
/kc ContainerSpecifies a key container name.

Examples

Sign an executable using a certificate file

signtool sign /f MyCert.pfx /p MyPassword /tr https://timestamp.digicert.com /td SHA256 /fd SHA256 MyApp.exe

Verify a signed file

signtool verify /pa /v MyApp.exe

Timestamp an already signed file

signtool timestamp /tr https://timestamp.digicert.com /td SHA256 MyApp.exe

Sign all DLLs in a directory

for %f in (*.dll) do signtool sign /a /tr https://timestamp.digicert.com /td SHA256 "%f"

See also