我正在尝试用我拥有的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错误:没有找到符合所有给定标准的证书。
我没有达到什么“标准”?这仅用于测试,因此这些是自签名证书。我尝试过导入密钥,然后对其进行签名,但它总是导致相同的错误。我怎么解决这个问题?
当前回答
我有同样的“私钥过滤后,0 certs被留下”的消息,我花了太多的时间试图弄清楚这条消息的意思。
问题是我在Windows证书存储中错误地安装了证书,因此没有与代码签名证书相关联的私钥。
我应该做的是:
Using either Firefox or Internet Explorer, submit the request to the issuer. This generates a PRIVATE KEY which is stored silently by the browser (a dialog appears for a fraction of a second in Firefox). Note that other browsers may not work: your life is too short to find out if they do. Submit the request, jump through the issuer's validation hoops and loops, sacrifice a goat, pray to the gods, submit a signed statement from your great grandparents, etc. Download the certificate (.crt) and import it into the same browser. The browser now has both the private key and the certificate. Export the certificate from the browser as a Personal Information Exchange (.p12) file. You will be asked to supply a password to protect this file. Keep a backup copy of the .p12 file. Run the Certificate Manager (certmgr.msc), right click on the Personal certificate store, select All Tasks/Import... and import the .p12 file into Windows. You will be asked for the password you used to protect the file. At this point, depending upon your security requirements, you can mark the key as exportable so you can restore a copy from the Windows store. You can also mark that a password is required before use if you want to break batch scripts. Run signtool successfully, breathe a sigh of relief, and ponder how much of your life you have wasted due to bad error messages and poor or missing documentation.
其他回答
同样的问题,原来是证书的私钥没有权限。 要修复-打开证书管理,找到您的证书,右键单击->管理私钥,然后在安全顶部确保您的用户被添加并给予权限,这为我修复了它。
我的问题是我不理解signtool选项。我为/n选项提供了与我的证书不匹配的东西。当我把它拿掉时,它就不再抱怨了。
我也有同样的问题,读了一些答案(贴在这里),我看到我的证书过期了。
只需从我的启动项目创建一个新的。然后在证书管理器删除了过期的证书。
现在一切都编译好了。
我在使用Git Bash时得到了这个错误。 使用PowerShell成功。 如果这对谁有帮助的话。
使用/debug,当您得到这条消息“After Private Key filter, 0 certs were left.”时,一个原因可能是pfx文件没有私钥。 当您将已安装的证书导出到pfx文件时,请确保启用复选框还包括私钥。