log.info("CA exists.");
    public void test01AddCA() throws Exception {        log.debug(">test01AddCA()");        boolean ret = false;        try {            Context context = getInitialContext();            IAuthorizationSessionHome authorizationsessionhome = (IAuthorizationSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("AuthorizationSession"), IAuthorizationSessionHome.class);            IAuthorizationSessionRemote authorizationsession = authorizationsessionhome.create();            authorizationsession.initialize(admin, "CN=TEST".hashCode());            SoftCATokenInfo catokeninfo = new SoftCATokenInfo();            catokeninfo.setKeySize(2048);            catokeninfo.setAlgorithm(SoftCATokenInfo.KEYALGORITHM_RSA);            catokeninfo.setSignatureAlgorithm(CATokenInfo.SIGALG_SHA_WITH_RSA);            // Create and active OSCP CA Service.            ArrayList extendedcaservices = new ArrayList();            extendedcaservices.add(new OCSPCAServiceInfo(ExtendedCAServiceInfo.STATUS_ACTIVE,                    "CN=OCSPSignerCertificate, " + "CN=TEST",                    "",                    2048,                    OCSPCAServiceInfo.KEYALGORITHM_RSA));            X509CAInfo cainfo = new X509CAInfo("CN=TEST",                    "TEST", SecConst.CA_ACTIVE,                    "", SecConst.CERTPROFILE_FIXED_ROOTCA,                    1,                    null, // Expiretime                    CAInfo.CATYPE_X509,                    CAInfo.SELFSIGNED,                    (Collection) null,                    catokeninfo,                    "Initial CA",                    -1, null,                    null, // PolicyId                    24, // CRLPeriod                    (Collection) new ArrayList(),                    true, // Authority Key Identifier                    false, // Authority Key Identifier Critical                    true, // CRL Number                    false, // CRL Number Critical                    true, // Finish User                    extendedcaservices);            cacheAdmin.createCA(admin, cainfo);            CAInfo info = cacheAdmin.getCAInfo(admin, "TEST");            X509Certificate cert = (X509Certificate) info.getCertificateChain().iterator().next();            assertTrue("Error in created ca certificate", cert.getSubjectDN().toString().equals("CN=TEST"));            assertTrue("Creating CA failed", info.getSubjectDN().equals("CN=TEST"));            ret = true;        } catch (CAExistsException pee) {        }        assertTrue("Creating CA failed", ret);        log.debug("<test01AddCA()");    }