1

I tried to digitally sign a hta file with signtool.exe but I got following error:

Done Adding Additional Store  
SignTool Error: This file format cannot be signed because it is not recognized.  
SignTool Error: An error occurred while attempting to sign:  
C:\test.hta

Number of errors: 1

How can I digitally sign a hta file?

user692942
  • 16,398
  • 7
  • 76
  • 175
seko
  • 11
  • 2
  • 1
    Sounds like the answer is no. – user692942 Jan 13 '21 at 12:11
  • Related (no mention of HTAs) - [Can I digitally sign JScript (.js) or VBScript (.vbs) files?](https://stackoverflow.com/a/34445527) – user692942 Jan 13 '21 at 12:16
  • Not the same file type but maybe give this a try? - [Error Signing Windows Phone XAP file -> SignTool Error: This file format cannot be signed because it is not recognized](https://stackoverflow.com/a/20973573) – user692942 Jan 13 '21 at 12:56
  • To be honest the `SignTool` should be able to sign most file formats, at the end of the day an HTA file is just an HTML text file. The above link suggests it might be because it's using the incorrect architecture version (x64, x86) of the SignTool. – user692942 Jan 13 '21 at 12:59
  • I installed the latest version of silverlight(5.1.50918.0) and tried both signtool.exe under x64 and x86 folders but I still got the same error. – seko Jan 13 '21 at 13:13

1 Answers1

1

I'm afraid you are out the luck as it appears that Microsoft's SignTool does not support the signing of HTA files. Have not been able to find anything that explicitly say's it's not supported but in my experience if you receive a message saying:

This file format cannot be signed because it is not recognized

Chances are it isn't supported.


user692942
  • 16,398
  • 7
  • 76
  • 175
  • Do you know any other tool which supports to the signing of HTA files? – seko Feb 01 '21 at 20:11
  • @seko If I did I would have stated that in my answer. While this may not be the answer you hoped for it still answers the original question, so please consider leaving an up-vote and maybe even [accepting the answer](https://stackoverflow.com/help/someone-answers). – user692942 May 13 '21 at 00:41
  • Would a Content Security Policy change the trust level? – dataphile Jun 29 '21 at 11:28