【问题标题】:How to strong sign an .exe file in .NET?如何在 .NET 中对 .exe 文件进行强签名?
【发布时间】:2020-08-18 10:48:41
【问题描述】:

如何使用机器上安装的 pfx 证书正确签署 .exe

我有一个名为“已安装服务”的pfx 证书。我尝试使用此命令签署exe

.\sn.exe -Rc "%Directory%\File.exe" "Services" >> "%LogPath%"

它没有给出任何错误。但是当我运行这个 exe 文件时,它开始为在 File.exe 项目中引用的内部项目 dll(ExtraFile.dll)抛出错误。

在签署 File.exe 文件之前,我已经签署了这个 dll。所以签名步骤如下。

.\sn.exe -Rc "%Directory%\ExtraFile.dll" "Services" >> "%LogPath%"
.\sn.exe -Rc "%Directory%\File.exe" "Services" >> "%LogPath%"

请注意,ExtraFile.dll 在 File.exe 项目下被引用。

【问题讨论】:

    标签: asp.net dll exe sign strongname


    【解决方案1】:

    使用强名称工具 (Sn.exe) 创建加密密钥对,并使用命令行编译器或程序集链接器 (Al.exe) 将该密钥对分配给程序集。 Windows SDK 提供 Sn.exe 和 Al.exe。

    【讨论】:

    • 请再次阅读我的问题。我正在做所有这些步骤。
    猜你喜欢
    • 2018-09-24
    • 2018-05-18
    • 1970-01-01
    • 2017-02-07
    • 2022-11-11
    • 2011-01-09
    • 2014-04-13
    • 2011-11-18
    • 1970-01-01
    相关资源
    最近更新 更多