简体   繁体   English

如何检查X509Certificate颁发者是否可信?

[英]how do I check if the X509Certificate issuer is trusted?

I have an instance of X509Certificate in java and I need to check if the issuer is trusted? 我在java中有一个X509Certificate实例,我需要检查发行者是否可信?

thanks gal 谢谢你

If you just have the certificate (out of context), you should build a certification path using the Java PKI Cert. 如果您只拥有证书(脱离上下文),则应使用Java PKI Cert构建证书路径 Path API . 路径API If it's within the context of SSL, you should be able to use a TrustManager and check it when using your SSLContext . 如果它在SSL的上下文中,您应该能够使用TrustManager并在使用SSLContext时进行检查。

This will verify whether the certificate was issued by a CA you trust (or via one of its intermediate CAs perhaps). 这将验证证书是否由您信任的CA(或通过其中间CA之一)颁发。

You may also be interested in " What data should I validate when validating X.509 certificates using Java? " (on Security.SE). 您可能还对“ 使用Java验证X.509证书时应该验证哪些数据? ”(在Security.SE上)感兴趣。

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

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