SignTool Error: ‘No File Timestamp Algorithm Specified. Please Specify the Timestamp Algorithm With the /td Flag’

Learn how to restyle your SignTool command to successfully add a timestamp to your Windows code and eliminate this error
Editor’s Note: This article is one in a series of pieces we will publish over the next few weeks that aim to help resolve code signing-related errors for SignTool, Jarsigner, Electron, and Windows.
Uh-oh. It looks like you forgot to define the algorithm.
Cryptographic algorithms are a fundamental part of the code signing and timestamping processes. Nevertheless, not all hashing algorithms are created equal. This is why if you forget to define in your script which type of secure timestamping algorithm SignTool should use, you’ll be greeted by this error message:

What ‘SignTool Error: No File Timestamp Algorithm Specified. Please Specify the Timestamp Algorithm With the /td Flag’ Means
This is another crystal-clear code signing error: you wanted to timestamp your signature, but you didn’t state which algorithm SignTool should use. Oops.
Thankfully, this code signing error is a quick and easy fix.
Possible Cause(s) for This Timestamp Algorithm Error
You omitted the mandatory /td option and algorithm from the code signing and timestamping command. SignTool.exe uses this information to specify the algorithm utilized by the RFC 3161-compliant server to generate your signature’s timestamp.
How to Fix the Error ‘No File Timestamp Algorithm Specified’
Insert the /td option followed by a secure signing algorithm (i.e., SHA256) just after the timestamp server’s URL.

Platform(s)/Systems Affected
SignTool.exe (Windows, Visual Studio Developer Command Prompt, Visual Studio Developer PowerShell).