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

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

由此,我得到:

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

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


当前回答

我在使用Git Bash时得到了这个错误。 使用PowerShell成功。 如果这对谁有帮助的话。

其他回答

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

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

我的问题是我不理解signtool选项。我为/n选项提供了与我的证书不匹配的东西。当我把它拿掉时,它就不再抱怨了。

同样的问题,原来是证书的私钥没有权限。 要修复-打开证书管理,找到您的证书,右键单击->管理私钥,然后在安全顶部确保您的用户被添加并给予权限,这为我修复了它。

以防其他人遇到这种情况:我的问题是,在使用signtool.exe应用程序之前,我需要以管理员身份运行命令提示符。然后一切都很好地工作。

当通过Visual Studio得到这个错误时,这是因为有一个签名证书设置来匹配它最初开发的计算机。

您可以通过转到项目属性>签名选项卡并检查证书详细信息来检查这一点。

您可以取消选中“Sign the ClickOnce清单”以禁用签名。

如果您不想关闭此选项,则必须安装证书。