Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 Java 和 KeyStore。
我在 KeyStore 中有一个公钥和私钥对。
当我读取证书并从证书中获取公钥时。
我如何知道证书中的公钥是否与密钥库中的私钥匹配?
我在 KeyStore 中有一个公钥和私钥对。 我如何知道证书中的公钥是否与密钥库中的私钥匹配?
由于 Keystore 包含对,因此您查找与证书具有相同公钥的对。
当然,这只是第一步。接下来,您(或更可能是 PKI 库)需要使用私钥来检查证书的签名。