private static void CRLDistributionPointsExtensionTest(String certStr) throws Exception { CertificateFactory cf = CertificateFactory.getInstance("X.509"); ByteArrayInputStream is = new ByteArrayInputStream(certStr.getBytes()); X509Certificate cert = (X509Certificate) cf.generateCertificate(is); // oid for CRL Distribution Points = 2.5.29.31 byte[] CDPExtBytes = cert.getExtensionValue("2.5.29.31"); DerValue val = new DerValue(CDPExtBytes); byte[] data = val.getOctetString(); CRLDistributionPointsExtension CDPExt = new CRLDistributionPointsExtension(false, data); }