store.findCertificateByFingerprint(adm, rootCaFp); } catch (Exception e) { store.storeCertificate(adm
if (store.findCertificateByFingerprint(adm, rootCaFp) == null) { store.storeCertificate(adm
    protected void setUp() throws Exception {        m_log.debug(">setUp()");        m_ctx = getInitialContext();                Object obj = m_ctx.lookup("CertificateData");        m_home = (CertificateDataHome) javax.rmi.PortableRemoteObject.narrow(obj,                CertificateDataHome.class);        Object obj2 = m_ctx.lookup("CertificateStoreSession");        m_storehome = (ICertificateStoreSessionHome) javax.rmi.PortableRemoteObject.narrow(obj2,                ICertificateStoreSessionHome.class);            ICertificateStoreSessionRemote store = m_storehome.create();        X509Certificate cert;        Admin adm = new Admin(Admin.TYPE_INTERNALUSER);        m_certs = new HashSet();        cert = CertTools.getCertfromByteArray(testrootcert);        m_certs.add(cert);        rootCaFp = CertTools.getFingerprintAsString(cert);        try {            store.findCertificateByFingerprint(adm, rootCaFp);        } catch (Exception e) {            store.storeCertificate(adm                                   , cert                                   , "o=AnaTom,c=SE"                                   , rootCaFp                                   , CertificateData.CERT_ACTIVE                                   , SecConst.CERTTYPE_ROOTCA);        }        cert = CertTools.getCertfromByteArray(testcacert);        m_certs.add(cert);        subCaFp = CertTools.getFingerprintAsString(cert);        try {            store.findCertificateByFingerprint(adm, subCaFp);                                                       } catch (Exception e) {            store.storeCertificate(adm                                   , cert                                   , "o=AnaTom,c=SE"                                   , subCaFp                                   , CertificateData.CERT_ACTIVE                                   , SecConst.CERTTYPE_SUBCA);        }        cert = CertTools.getCertfromByteArray(testcert);        m_certs.add(cert);        endEntityFp = CertTools.getFingerprintAsString(cert);        try {            store.findCertificateByFingerprint(adm, endEntityFp);        } catch (Exception e) {            store.storeCertificate(adm                                   , cert                                   , "o=AnaTom,c=SE"                                   , endEntityFp                                   , CertificateData.CERT_ACTIVE                                   , SecConst.CERTTYPE_ENDENTITY);                }        m_log.debug("<setUp()");    }