CertificateDataPK revpk = new CertificateDataPK(fp); CertificateData rev = home.findByPrimaryKey(revpk); long date = rev.getRevocationDate(); String date1 = new Date(date).toString(); String date2 = new Date(revDate).toString(); assertEquals("Revocation date is not as expected: ", date2, date1); assertTrue(rev.getStatus() == CertificateData.CERT_REVOKED);
CertificateInfo rev = store.getCertificateInfo(admin, fp); log.info("revocationdate (after rev)=" + rev.getRevocationDate()); assertTrue("Revocation date in future.", new Date().compareTo(rev.getRevocationDate())>=0); assertTrue(rev.getStatus() == CertificateDataBean.CERT_REVOKED);
    public void test04CheckRevoked() throws Exception {        log.debug(">test04CheckRevoked()");        ICertificateStoreSessionRemote store = storehome.create();        String issuerDN = CertTools.getIssuerDN(cert);        String subjectDN = CertTools.getSubjectDN(cert);        // List all certificates for user foo, which we have created in TestSignSession        Collection certfps = store.findCertificatesBySubjectAndIssuer(new Admin(Admin.TYPE_INTERNALUSER), subjectDN, issuerDN);        assertNotNull("failed to list certs", certfps);        assertTrue("failed to list certs", certfps.size() != 0);        // Verify that cert are revoked        Iterator iter = certfps.iterator();        while (iter.hasNext()) {            X509Certificate cert = (X509Certificate) iter.next();            String fp = CertTools.getFingerprintAsString(cert);            CertificateDataPK revpk = new CertificateDataPK(fp);            CertificateData rev = home.findByPrimaryKey(revpk);            long date = rev.getRevocationDate();            String date1 = new Date(date).toString();            String date2 = new Date(revDate).toString();            assertEquals("Revocation date is not as expected: ", date2, date1);            assertTrue(rev.getStatus() == CertificateData.CERT_REVOKED);        }        log.debug("<test04CheckRevoked()");    }