作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
在尝试签署由我工作的公司创建的一些安装程序时,我遇到了一个错误,我无法解决。我正在使用已在另一台机器(Win7)上成功使用的相同证书,以相同的方式为准相同的安装程序签名。无论如何,在运行 CruiseControl.net 的 Windows Server 2008 上,我尝试使用 signtool.exe 对安装程序进行签名,但失败并显示以下错误:
The following certificates were considered:
Issued to: <our company>
Issued by: <some ca>
Expires: <is valid>
SHA1 hash: <...>
Issued to: <...>
Issued by: <...>
Expires: <...>
SHA1 hash: <...>
After EKU filter, 1 certs were left.
After expiry filter, 1 certs were left.
After Subject Name filter, 1 certs were left.
After Private Key filter, 0 certs were left.
SignTool Error: No certificates were found that met all the given criteria.
signtool.exe sign /debug /n "MyCompany" C:\my\installer.exe
signtool.exe sign /debug /f C:\path\to\my\certificate.cer C:\my\installer.exe
最佳答案
为了对文件进行签名,您需要拥有证书的私钥,该私钥不包含在您从 Windows 7 机器复制的 *.cer 文件中。要使用私钥导出证书,您可以按照 instructions supplied here .
请注意,如果证书在创建时设置为允许导出,您将只能导出私钥(通过将 -pe
传递给 makecert
)
关于windows - 由于私钥过滤器,使用 signtool 进行代码签名失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28690986/
我是一名优秀的程序员,十分优秀!