log.info("No certs for " + alias + ", untrusted.");
} else if (certs.length > 1) {
X509Certificate x509cert = (X509Certificate) certs[certs.length - 1];
TrustedCACertStore store = new TrustedCACertStore();
ByteArrayInputStream bin = new ByteArrayInputStream(x509cert.getEncoded());
DERInputStream der = null;
try {
der = new DERInputStream(bin);
ASN1Sequence certificate = (ASN1Sequence) der.readObject();
com.maverick.crypto.asn1.x509.X509Certificate x509 = new com.maverick.crypto.asn1.x509.X509Certificate(
X509CertificateStructure.getInstance(certificate));
return store.isTrustedCertificate(x509, false, false);
} finally {
Util.closeStream(der);