assertEquals("Wrong certificate policy", "1.1.1.1.1.1", CertTools.getCertificatePolicyId(cert));
assertEquals("Wrong certificate policy", "1.1.1.1.1.1", CertTools.getCertificatePolicyId(cert, 0)); assertNull("Not null policy", CertTools.getCertificatePolicyId(cert, 1));
    public void test06CertOps() throws Exception {        log.debug(">test06CertOps()");        X509Certificate cert = CertTools.getCertfromByteArray(testcert);        assertEquals("Wrong issuerDN",CertTools.getIssuerDN(cert),CertTools.stringToBCDNString("CN=TestCA,O=AnaTom,C=SE"));        assertEquals("Wrong subjectDN",CertTools.getSubjectDN(cert),CertTools.stringToBCDNString("CN=p12test,O=PrimeTest,C=SE"));        assertEquals("Wrong subject key id", new String(Hex.encode(CertTools.getSubjectKeyId(cert))),"E74F5690F48D147783847CD26448E8094ABB08A0".toLowerCase());        assertEquals("Wrong authority key id", new String(Hex.encode(CertTools.getAuthorityKeyId(cert))),"637BF476A854248EA574A57744A6F45E0F579251".toLowerCase());        assertEquals("Wrong upn alt name", "foo@foo", CertTools.getUPNAltName(cert));        assertEquals("Wrong certificate policy", "1.1.1.1.1.1", CertTools.getCertificatePolicyId(cert));//        System.out.println(cert);//        FileOutputStream fos = new FileOutputStream("foo.cert");//        fos.write(cert.getEncoded());//        fos.close();        log.debug("<test06CertOps()");    }