windows - signtool 为代码签名选择了错误的(旧的)证书

标签 windows certificate code-signing signtool

我有一个我完全不明白的问题。几天前,我从我们的供应商 (GlobalSign) 那里颁发了一份新的代码签名证书。

在使用执行构建/代码签名的用户登录到构建服务器后,我启动了 certmgr,导航到个人证书存储并删除旧证书。然后我使用“导入”对话框导入新证书,包括它的私钥。

测试版本显示 signtool 仍然使用 证书对应用程序进行签名。但是,我无法在 certmgr 中的任何位置找到此证书,甚至无法通过搜索该证书的 SHA1 校验和来找到它。

谷歌搜索后,我找到了这篇博文:http://qualapps.blogspot.de/2008/07/installing-code-signing-certificate.html 它声明如下:

Remove your old certificate. If you are renewing an existing certificate, then keeping the old certificates installed isn't usually useful, and having multiple certificates will break SIGNTOOL if signtool is searching the certificate store. Go to Control Panel / Internet Options / Content, click Certificates, select your old certificate, and click Remove. The old certificate will probably be on the Personal page if you allowed PVKIMPRT to decide where to put it.

我按照这些说明进行操作,但我唯一能找到的就是新证书。

"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool" sign /v /sm /n "my company name" /tr http://tsa.starfieldtech.com "the-setup.exe"

“我的公司名称”是旧证书和新证书中都包含的名称。

一个。如何找出旧证书仍存储在哪里并将其删除? b.我怎样才能强制 signtool 使用新证书,或者至少失败?!

最佳答案

使用 PFX 文件并引用它的解决方法是一个很好的解决方案。

但是,您可以尝试以下操作:

  • 将参数/s MY 添加到signtool 参数链。 “我的”链接到个人商店。

  • 在 certmgr.msc 中,查看其他商店,如果它们不包含旧证书的副本

  • /a 添加到参数链中。这将导致“自动选择最佳签名证书”(不管这意味着什么 :))

  • 您可以等到旧证书过期。之后,它应该自动只使用新证书

关于windows - signtool 为代码签名选择了错误的(旧的)证书,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36495663/

相关文章:

c++ - 强制 QWidget Child 有自己的窗口句柄

web-services - curl 命令 - 无法加载客户端证书 -8018

android - 无法通过 faSTLane 使用 Google Play 应用签名将 android 包上传到 Google Play

java - 如何使用证书保护 Spring Soap 服务

ssl - 请使用 ssl 证书发送 https 请求

android - "Package file was not signed correctly"错误 -- 检测它是否会发生在 Google Play 应用程序 apk 上

ios - 我是否需要将 Entitlements.plist 文件设置为我的目标才能使推送通知正常工作?

c++ - C+ +'s "系统“无需等待 (Win32)

c++ - QtCharts setRange问​​题

python - 使用 Python 进行 Windows 进程管理