CertificateDataPK pk = new CertificateDataPK(); pk.fingerprint = CertTools.getFingerprintAsString(cert); CertificateData data3 = home.findByPrimaryKey(pk);
ICertificateStoreSessionRemote store = storehome.create(); String fp = CertTools.getFingerprintAsString(cert); CertificateInfo data3 = store.getCertificateInfo(admin, fp);
    public void test08IsRevoked() throws Exception {        log.debug(">test08IsRevoked()");        CertificateDataPK pk = new CertificateDataPK();        pk.fingerprint = CertTools.getFingerprintAsString(cert);        CertificateData data3 = home.findByPrimaryKey(pk);        assertNotNull("Failed to find cert", data3);        log.debug("found by key! =" + data3);        log.debug("fp=" + data3.getFingerprint());        log.debug("issuer=" + data3.getIssuerDN());        log.debug("subject=" + data3.getSubjectDN());        log.debug("cafp=" + data3.getCAFingerprint());        assertNotNull("wrong CAFingerprint", data3.getCAFingerprint());        log.debug("status=" + data3.getStatus());        assertTrue("wrong status", data3.getStatus() == CertificateData.CERT_REVOKED);        log.debug("type=" + data3.getType());        assertTrue("wrong type", (data3.getType() & SecConst.USER_ENDUSER) == SecConst.USER_ENDUSER);        log.debug("serno=" + data3.getSerialNumber());        log.debug("expiredate=" + data3.getExpireDate());        log.debug("revocationdate=" + data3.getRevocationDate());        log.debug("revocationreason=" + data3.getRevocationReason());        assertTrue("wrong reason", (data3.getRevocationReason() == RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED));        log.debug("Checking if cert is revoked DN:'" + CertTools.getIssuerDN(cert) + "', serno:'" + cert.getSerialNumber().toString() + "'.");        ICertificateStoreSessionRemote store = storehome.create();        RevokedCertInfo revinfo = store.isRevoked(new Admin(Admin.TYPE_INTERNALUSER), CertTools.getIssuerDN(cert), cert.getSerialNumber());        assertNotNull("Certificate not found, it should be!", revinfo);        int reason = revinfo.getReason();        assertEquals("Certificate not revoked, it should be!", RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED, reason);        assertTrue("Wrong revocationDate!", revinfo.getRevocationDate().getTime() == data3.getRevocationDate());        assertTrue("Wrong reason!", revinfo.getReason() == data3.getRevocationReason());        home.remove(pk);        log.debug("Removed it!");        log.debug("<test08IsRevoked()");    }