title: "Invalid SHA1 hash format" error calling signtool from msbuild or command line
body: <p>I am trying to sign my assemblies and setup files during project build using <a href="https://msdn.microsoft.com/en-us/library/8s9b9yaz(v=vs.110).aspx" rel="nofollow noreferrer">SignTool.exe</a>. Following <a href="https://stackoverflow.com/a/18533372/1730559">this answer</a> I wanted to use the <code>/sha1</code> option so that I don't need to specify the certificate password. However, when I do this I am getting an "Invalid SHA1 hash format" error. I have tried both from an MSBuild <code>Exec</code> task, from a Visual Studio Developer Command prompt and from a batch file all with the same error.</p>
  
  <p>The command I'm trying is (obviously with a different key):</p>
  
  <pre><code>signtool.exe sign /a /sha1 ‎1234567890abcdef1234567890abcdef12345678 /tr http://timestamp.comodoca.com /td SHA256 /v Setup.msi
  </code></pre>
  
  <p>I think my certificate is installed correctly and the SHA1 key is correct as it works with the <a href="https://msdn.microsoft.com/en-us/library/ms164304.aspx" rel="nofollow noreferrer">SignFile MSBuild task</a> correctly. I'd just use that but I also need to be able to sign my installer files which aren't built with MSBuild and hence need to be signed from a batch script.</p>
  
  <p>So what could be the problem and how do I fix it?</p>