简体   繁体   English

由于私钥过滤,signtool无法在Windows 10上找到证书

[英]signtool fails to find certificate on Windows 10, due to private key filter

I am the developer of UniversalADBDriver, a tool that creates a self signed Android USB driver on the user's computer. 我是UniversalADBDriver的开发者,这是一种在用户计算机上创建自签名Android USB驱动程序的工具。

Source code of installer and setup package: https://github.com/koush/UniversalAdbDriver 安装程序和安装程序包的源代码: https//github.com/koush/UniversalAdbDriver

The tool generates a keypair and adds a certificate to the user's key store, then signs the driver files. 该工具生成密钥对并将证书添加到用户的密钥库,然后签署驱动程序文件。 This worked fine until Windows 10, where it inexplicably stopped working. 这工作正常,直到Windows 10,莫名其妙地停止工作。 I ran the command line manually: 我手动运行命令行:

The following certificates were considered:
    Issued to: UniversalADB
    Issued by: UniversalADB
    Expires:   Fri Aug 25 17:00:00 2017
    SHA1 hash: C8701DF4CDC7DD75813400AD2B3B4C2EFDA4E662

After EKU filter, 1 certs were left.
After expiry 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.

On Windows 10, the certificate is being filtered out by the "Private Key filter". 在Windows 10上,证书正由“私钥过滤器”过滤掉。 No idea what that is, no documentation anywhere on it. 不知道那是什么,没有任何文档。

UPDATE UPDATE

I've discovered that neither makecert.exe or X509Store.add can write certificates/keys to the Current User store when invoked through the installer on Windows 10. However, the certificates in the Local Machine store are placed correctly. 我发现在Windows 10上通过安装程序调用时,makecert.exe或X509Store.add都不能将证书/密钥写入当前用户存储。但是,本地计算机存储中的证书是正确放置的。 I'm not sure why that is. 我不知道为什么会这样。 So basically, the private key is not being placed in the store properly so the signature fails. 所以基本上,私钥没有正确放置在商店中,因此签名失败。 Running the same steps manually on the command line works. 在命令行上手动运行相同的步骤。 I still need to figure out why the private key is not being persisted in the store however. 我仍然需要弄清楚为什么私钥没有在商店中持久存在。

I was using BouncyCastle to generate a certificate programatically. 我正在使用BouncyCastle以编程方式生成证书。 For some reason, this certificate does not seem to work anymore on Windows 10. I switched to packaging makecert.exe for the certificate generation, and that seemed to fix it. 出于某种原因,此证书在Windows 10上似乎不再起作用。我切换到打包makecert.exe以生成证书,这似乎解决了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM