Object obj = m_ctx.lookup("CertificateData"); m_home = (CertificateDataHome) javax.rmi.PortableRemoteObject.narrow(obj, CertificateDataHome.class);
    protected void setUp() throws Exception {        m_log.debug(">setUp()");        CertTools.installBCProvider();        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);        boolean stored = false;        try {            if (store.findCertificateByFingerprint(adm, rootCaFp) == null) {                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);            if (store.findCertificateByFingerprint(adm, subCaFp) == null) {                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);            if (store.findCertificateByFingerprint(adm, endEntityFp) == null) {                store.storeCertificate(adm                        , cert                        , "o=AnaTom,c=SE"                        , endEntityFp                        , CertificateData.CERT_ACTIVE                        , SecConst.CERTTYPE_ENDENTITY);            }        } catch (Exception e) {            m_log.error("Error: ", e);            assertTrue("Error seting up tests: " + e.getMessage(), false);        }        admin = new Admin(Admin.TYPE_INTERNALUSER);        m_log.debug("<setUp()");    }