使用 .Net 延迟签名和 Digicert 证书

Using .Net Delayed Signing With Digicert Certificate

我们有一个来自 digicert 的 pfx 签名密钥,我们将其用作延迟签名,但是当我们将它安装在计算机上时,它不会 运行,除非我们为该延迟签名密钥添加排除项(sn.exe-Vr*,)。这应该是可能的,对吧?或者我错过了什么?我创建了延迟签名密钥:

sn -p d:\DigCert.pfx DelayedSigning.snk

然后我们在 C# .net 程序集中使用 DelayedSigning.snk 作为延迟签名:

然后编译混淆后,我们使用signtool用全密钥进行签名:

signtool.exe sign /f d:\DigCert.pfx /p ourPW /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a outputPath\*.dll

然后就像我说的,如果我们尝试 运行 干净 windows 10 OS 它不会工作,除非我们添加延迟签名排除(sn.exe -Vr *,)。有什么想法吗?

注意:当我在其中一个程序集上 运行 sn -V 时,它显示 "XXXXX.dll is a delay-signed or test-signed assembly" - 怎么会这样?

感谢您的回复,是的,我终于意识到强名称签名和代码签名是两个不同的东西。解决方案是为强签名创建单独的签名代码:https://docs.microsoft.com/en-us/dotnet/standard/assembly/create-use-strong-named and then create a delayed signing key: https://docs.microsoft.com/en-us/dotnet/standard/assembly/delay-sign and use this in projects with delayed signing. Before shipping would sign it with sn.exe with the private strong-name signing key (info in last link). Then after it's strong name signed, sign with the digicert certificate with signtool.exe. https://www.digicert.com/kb/code-signing/signcode-signtool-command-line.htm