【问题标题】:the signing certificate and private key do not match or do not contain valid information签名证书和私钥不匹配或不包含有效信息
【发布时间】:2012-05-24 08:40:07
【问题描述】:
我正在做一个安装项目,我想签署我的“setup.exe”文件。
对于这个问题,我有;
- “setup.exe”文件
- 一个“aaa.pfx”文件(我也使用这个 pfx 文件作为我的站点 ssl 证书。)
首先,
我将 pfx 文件转换为 crt 和 pvk 以上命令。
- 导出私钥:
openssl pkcs12 -in filename.pfx -nocerts -out key.pvk
- 出口证书:
openssl pkcs12 -in filename.pfx -clcerts -nokeys -out cert.crt
我正在使用 windows signwizard 工具进行签名,
步骤:
- 我选择了我的“setup.exe”文件
- 我选择了我的“cert.crt”
- 我选择了“key.pvk”,这会得到一个像图片一样的错误;
有什么建议吗?
【问题讨论】:
标签:
openssl
installation
setup-deployment
sign
signtool
【解决方案1】:
您是否尝试过类似的方法:
1.
openssl sha256 -out digest.txt setup.exe
2.
openssl dgst -sha256 -sign key.pvk -out signed_setup.exe digest.txt
【解决方案2】:
您说您对 SSL 站点证书使用相同的 PFX(相当于 PKCS#12)。
这就是问题所在:你不能使用TLS Web Server Authentication, TLS Web Client Authentication这样的证书来签署setup.exe这样的代码
读取导出的证书时使用
openssl x509 -in cert.crt -text
你必须寻找X509v3 Extended Key Usage:这一行。
要签署代码,必须是:Code Signing, Microsoft Commercial Code Signing,这是不同的服务和证书颁发机构提供商的不同价格!