Java CertPath

Jakob Jenkov
Last update: 2018-02-14

The Java CertPath class (java.security.cert.CertPath 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.

getCertificates()

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();

getType()

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

Featured Videos

Java ConcurrentMap + ConcurrentHashMap

Java Generics

Java ForkJoinPool

P2P Networks Introduction

















Close TOC
All Tutorial Trails
All Trails
Table of contents (TOC) for this tutorial trail
Trail TOC
Table of contents (TOC) for this tutorial
Page TOC
Previous tutorial in this tutorial trail
Previous
Next tutorial in this tutorial trail
Next