如何验证证书的根信任
我是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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,它确实是这样做的: 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