我正在尝试用我拥有的pfx文件签署Windows 8 appx包。我使用如下命令:

signtool.exe sign /fd sha256 /f "key.pfx" "app.appx"

由此,我得到:

SignTool错误:没有找到符合所有给定标准的证书。

我没有达到什么“标准”?这仅用于测试,因此这些是自签名证书。我尝试过导入密钥,然后对其进行签名,但它总是导致相同的错误。我怎么解决这个问题?


当前回答

在我的情况下,我有错误的证书类型,我试图关联。我选择了“服务器认证”而不是“代码签名”。 您应该能够在预期用途部分的Certificate snap中看到这一点。在那之后,它就可以正常工作了。

其他回答

我也有这个问题,试了很多。使用SDK和Visual Studio签名,但是到处都是“没有找到符合所有给定标准的证书”。

解决方案: 注意,如果"after private key filter": '0 left'显示选项signtool sign /debug…,原因是你的PC没有CA本身在商店。要解决这个问题,首先安装CA(在我的例子中是一个.crt文件),然后再次运行符号。它现在应该可以工作了!

Signtool只能与同一台PC拥有的请求为ánd的CA一起使用。

使用/debug,当您得到这条消息“After Private Key filter, 0 certs were left.”时,一个原因可能是pfx文件没有私钥。 当您将已安装的证书导出到pfx文件时,请确保启用复选框还包括私钥。

我有这个问题,我不完全确定下面的哪一步使它工作,但希望这有助于其他人…这就是我所做的:

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

我在控制台应用程序开发中遇到了同样的问题,作为一个快速的解决方案,

那就去项目物业,

点击签名选项卡,取消选中“签名ClickOnce清单”。

图片描述:

供你参考,你也可以看到这个少于一分钟的视频解决方案。上面的图片是从视频中截取的。

转到项目属性,在初始化编译之前取消选中Firm中的所有字段