我正在尝试用我拥有的pfx文件签署Windows 8 appx包。我使用如下命令:
signtool.exe sign /fd sha256 /f "key.pfx" "app.appx"
由此,我得到:
SignTool错误:没有找到符合所有给定标准的证书。
我没有达到什么“标准”?这仅用于测试,因此这些是自签名证书。我尝试过导入密钥,然后对其进行签名,但它总是导致相同的错误。我怎么解决这个问题?
我正在尝试用我拥有的pfx文件签署Windows 8 appx包。我使用如下命令:
signtool.exe sign /fd sha256 /f "key.pfx" "app.appx"
由此,我得到:
SignTool错误:没有找到符合所有给定标准的证书。
我没有达到什么“标准”?这仅用于测试,因此这些是自签名证书。我尝试过导入密钥,然后对其进行签名,但它总是导致相同的错误。我怎么解决这个问题?
当前回答
我有这个问题,我不完全确定下面的哪一步使它工作,但希望这有助于其他人…这就是我所做的:
Install the downloaded certificate (.crt) into certificates (I put it into “personal” store) - right click on .crt file and click Install Certificate. Run certmgr.msc and export the certificate (found in whichever store you used in the 1st step) as a pfx file including private key and extended properties Use the exported .pfx file when signing your project Example signtool: signtool sign /f "c:\mycert.pfx" /p mypassword /d "description" /t http://timestamp.verisign.com/scripts/timstamp.dll $(TargetPath) where the password is the same as provided during Export
其他回答
我也有同样的问题,读了一些答案(贴在这里),我看到我的证书过期了。
只需从我的启动项目创建一个新的。然后在证书管理器删除了过期的证书。
现在一切都编译好了。
转到项目属性,在初始化编译之前取消选中Firm中的所有字段
尝试使用/debug。1,2如:
signtool sign /debug /f mypfxfile.pfx /p <password> (mydllexectuable).exe
它将帮助您了解发生了什么。你应该得到这样的输出:
The following certificates were considered:
Issued to: <issuer>
Issued by: <certificate authority> Class 2 Primary Intermediate Server CA
Expires: Sun Mar 01 14:18:23 2015
SHA1 hash: DD0000000000000000000000000000000000D93E
Issued to: <certificate authority> Certification Authority
Issued by: <certificate authority> Certification Authority
Expires: Wed Sep 17 12:46:36 2036
SHA1 hash: 3E0000000000000000000000000000000000000F
After EKU filter, 2 certs were left.
After expiry filter, 2 certs were left.
After Private Key filter, 0 certs were left.
SignTool Error: No certificates were found that met all the given criteria.
您可以查看是哪个过滤器导致您的证书无法工作,或者是否没有考虑证书。
我改变了哈希值和其他信息,但你应该明白。
1请注意:signtool对/debug选项放置的位置有特殊要求。它需要跟在sign语句后面。 另外注意:/debug选项只适用于某些版本的signtool。WDK版本有这个选项,而Windows SDK版本没有。
同样的问题,原来是证书的私钥没有权限。 要修复-打开证书管理,找到您的证书,右键单击->管理私钥,然后在安全顶部确保您的用户被添加并给予权限,这为我修复了它。
如果你不需要签署应用程序,右键单击你的项目
项目属性->签名->取消勾选“签署ClickOnce清单”
正如这篇文章所指出的,
如果你使用的是Visual Studio 2008,目标是。net 3.5并使用自动更新,你只需更改证书并部署一个新版本,