Tech and Media Labs
This site uses cookies to improve the user experience.

Java CertPath

Jakob Jenkov
Last update: 2018-02-14

The Java CertPath class ( represents a chain of cryptographic identity certificates (Java Certificate objects), where each certificate is the digital signer of the next certificate in the chain. The Java CertPath class is typically used to verify an identity certificate along with the certificates of the Certificate Authorities (CAs) that signed the certificate.

Obtaining a CertPath Instance

You will typically obtain a Java CertPath instance from a CertificateFactory or a CertPathBuilder. See the Java CertificateFactory tutorial for information about obtaining a CertPath instance.


Once you have a Java CertPath instance you can obtain the Certificate instances the CertPath consists of by calling the CertPath getCertificates() method. Here is an example of obtaining the certificates from a CertPath instance:

List<Certificate> certificates = certPath.getCertificates();


The CertPath getType() method returns a string telling what type of certificates (e.g. X.509) this CertPath instance contains. Here is an example of obtaining the CertPath type via getType():

String type = certPath.getType();

Jakob Jenkov

Copyright  Jenkov Aps
Close TOC