CertificateDataPK revpk = new CertificateDataPK(fp); CertificateData rev = home.findByPrimaryKey(revpk); rev.setStatus(CertificateData.CERT_REVOKED); rev.setRevocationReason(RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED); rev.setRevocationDate(revDate);
store.revokeCertificate(admin, cert, null, RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED);
    public void test03listAndRevoke() throws Exception {        log.debug(">test03listAndRevoke()");        ICertificateStoreSessionRemote store = storehome.create();        String issuerDN = CertTools.getIssuerDN(cert);        String subjectDN = CertTools.getSubjectDN(cert);        // List all certificates to see        Collection certfps = store.listAllCertificates(new Admin(Admin.TYPE_INTERNALUSER), issuerDN);        assertNotNull("failed to list certs", certfps);        assertTrue("failed to list certs", certfps.size() != 0);        int size = certfps.size();        log.debug("List certs: " + size);        // List all certificates for user foo, which we have created in TestSignSession        certfps = store.findCertificatesBySubjectAndIssuer(new Admin(Admin.TYPE_INTERNALUSER), subjectDN, issuerDN);        assertTrue("something weird with size, all < foos", size >= certfps.size());        log.debug("List certs for foo: " + certfps.size());        revDate = new Date().getTime();        Iterator iter = certfps.iterator();        while (iter.hasNext()) {            X509Certificate cert = (X509Certificate) iter.next();            String fp = CertTools.getFingerprintAsString(cert);            log.debug(fp);            // Revoke all foos certificates            CertificateDataPK revpk = new CertificateDataPK(fp);            CertificateData rev = home.findByPrimaryKey(revpk);            rev.setStatus(CertificateData.CERT_REVOKED);            rev.setRevocationReason(RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED);            rev.setRevocationDate(revDate);            log.debug("Revoked cert " + fp);        }        log.debug("<test03listAndRevoke()");    }