Code example for CertPath

Methods: getCertificates

        return parameters;
    void validateCertPath(CertPath path) {
        List<? extends Certificate> certificates = path.getCertificates();
        Certificate certificate = certificates.get(0);
        assertEquals("unexpected certificate type", "X.509", certificate
        X509Certificate x509Certificate = (X509Certificate) certificate;
        X500Principal subjectX500Principal = x509Certificate
        X500Principal expectedPrincipal = new X500Principal("CN=Android CTS, "
                + "OU=Android, O=Android, L=Android, ST=Android, C=AN"); 
        assertEquals("unexpected principal", expectedPrincipal,
Connect your IDE to all the code out there  Get Codota for Java