如何验证证书的根信任

发布于 2024-08-29 00:19:25 字数 346 浏览 3 评论 0原文

我是java安全新手。 我有一个使用自签名根证书签名的证书。假设 client.pem 是签名证书,而 root.pem 是根证书。

签名的证书嵌入到客户端程序中。

当连接到服务器程序时。

我需要验证调用是否来自验证客户端。客户端应将其证书发送到服务器。

我需要使用 Java API 检查 cleint.pem 是否实际上是用 root.pem 签名的。

我对 java.security.cert.Certificate.verify(PublicKey key) 方法有一些想法来验证两个相同的证书。但这对于验证信任根有用吗?

有什么可以帮忙的吗?

谢谢 阿比

I am new to java security.
I have a certificate which is signed with a self signed root certificate .Say client.pem is the signed certificate and root.pem is the root certificate.

The signed certificate is embedded into the client program.

When connection is made it to the server program.

Ineed to verify the call is from authenticate client.The client shall sent its certificate to the server.

I need to check whether cleint.pem is actually signed with root.pem using Java API.

i have some idea about java.security.cert.Certificate.verify(PublicKey key) method to verify two same certificates.But is this will be useful to verify root of trust ?

can any please help ?

thanks
abhi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妞丶爷亲个 2024-09-05 00:19:25

是的,它确实是这样做的: clientCert.verify(rootCert.getPublicKey()) 检查 clientCert 是否使用 root 的私钥进行签名

Yes, it does exactly that: clientCert.verify(rootCert.getPublicKey()) checks that clientCert was signed with the private key of root

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文