I have an instance of X509Certificate in java and I need to check if the issuer is trusted?
thanks gal
If you just have the certificate (out of context), you should build a certification path using the Java PKI Cert. Path API. If it's within the context of SSL, you should be able to use a TrustManager
and check it when using your SSLContext
.
This will verify whether the certificate was issued by a CA you trust (or via one of its intermediate CAs perhaps).
You may also be interested in "What data should I validate when validating X.509 certificates using Java?" (on Security.SE).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With