duano3557
2018-08-07 00:54 阅读 84
已采纳

有什么方法可以对Go编译器生成的Windows可执行文件进行签名?

I am trying to find out if there is a possibility to sign executables produced by the Go compiler. I cannot see this in the build/compile options. Is this even possible?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    dsdtszi0520538 dsdtszi0520538 2018-08-07 01:45

    Signing an executable is not the responsibility of the compiler, but it is part of the build process. Change your build script to run signtool.exe after the Go compiler has generated your EXE or DLL file. Provide the path and password to the private key file (if using a .pfx file) and it will sign it for you. This is the same process that Visual Studio uses.

    https://docs.microsoft.com/en-us/windows/desktop/seccrypto/signtool

    点赞 评论 复制链接分享

相关推荐