c# - 如何正确签署可执行文件

标签 c# visual-studio-2010 uac digital-signature

我做了一个小工具。它是一个控制台应用程序,在 Win7 上运行时会带来 UAC 安全提示。 我尝试使用以下步骤在 Visual Studio 2010 中签署此 EXE 文件:

  1. 项目属性
  2. 签名
  3. 如下所示创建新 key

enter image description here

key 文件已成功创建,如下图所示。

enter image description here

问题:

文件仍被 UAC 安全提示阻止。当我使用 signtool.exe 检查文件是否签名时,它告诉我,没有找到签名。 如果我按照错误的步骤操作,请纠正我。

enter image description here

最佳答案

程序集签名 != Authenticode 签名。

要使用 signtool 对程序集进行 authenticode 签名,您需要来自受信任的颁发机构的代码签名证书。

然后您可以发出以下构建后命令来签署您的可执行文件:

"signtool.exe" sign /f "$(SolutionDir)myCertificate.pfx" /p certPassword /d "description" /du "http://myinfourl" /t "http://timeserver.from.cert.authority/" $(TargetPath)

Everything you need to know about Authenticode Code Signing

关于c# - 如何正确签署可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16673086/

相关文章:

c# - DataBinding 不适用于列表

c++ - 使用 VS2010 构建 openSmile 库

c++ - 如何从 Vista 和 Windows 7 上的应用程序启动屏幕键盘

windows-vista - 为什么在 MS Vista 中对 ProgramData 文件夹进行虚拟化?

c# - 如何使用 mvc 4 web api 中的 HttpResponseMessage 对象设置 etag?

c# - Linq to Entities - 将 string[] 中带有 TagID 的所有对象插入 ICollection<Tag>

c# - List<List<Vector3>> 完全重复

c - 将 Led 重置为 LOW 形式 Visual Studio 到 arduino

c# - 在 Visual C# Express 2010 和 .net 4 中使用 NUnit

c - list 文件中的 requestExecutionLevel 和 CopyFile() 函数失败