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