Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

thanks gal

like image 759
Gal Tamir Avatar asked Nov 05 '22 04:11

Gal Tamir


1 Answers

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).

like image 128
Bruno Avatar answered Nov 09 '22 10:11

Bruno