X509Certificate cacert = null;;
X509Certificate cacert = null;
    private X509Certificate addECDSACA() throws Exception {        log.debug(">addECDSACA()");        boolean ret = false;        X509Certificate cacert = null;;        try {            Context context = getInitialContext();            IAuthorizationSessionHome authorizationsessionhome = (IAuthorizationSessionHome) javax.rmi.PortableRemoteObject.narrow(context.lookup("AuthorizationSession"), IAuthorizationSessionHome.class);            IAuthorizationSessionRemote authorizationsession = authorizationsessionhome.create();            authorizationsession.initialize(admin, "CN=OCSPECDSATEST".hashCode());            Object obj1 = context.lookup("CAAdminSession");            ICAAdminSessionHome cacheHome = (ICAAdminSessionHome) javax.rmi.PortableRemoteObject.narrow(obj1, ICAAdminSessionHome.class);            ICAAdminSessionRemote cacheAdmin = cacheHome.create();            SoftCATokenInfo catokeninfo = new SoftCATokenInfo();            catokeninfo.setSignKeySpec("prime192v1");            catokeninfo.setEncKeySpec("1024");            catokeninfo.setSignKeyAlgorithm(SoftCATokenInfo.KEYALGORITHM_ECDSA);            catokeninfo.setEncKeyAlgorithm(SoftCATokenInfo.KEYALGORITHM_RSA);            catokeninfo.setSignatureAlgorithm(CATokenInfo.SIGALG_SHA256_WITH_ECDSA);            catokeninfo.setEncryptionAlgorithm(CATokenInfo.SIGALG_SHA1_WITH_RSA);            // Create and active OSCP CA Service.            ArrayList extendedcaservices = new ArrayList();            extendedcaservices.add(new OCSPCAServiceInfo(ExtendedCAServiceInfo.STATUS_ACTIVE,                    "CN=OCSPSignerCertificate, " + "CN=OCSPECDSATEST",                    "",                    "prime192v1",                    CATokenConstants.KEYALGORITHM_ECDSA));            X509CAInfo cainfo = new X509CAInfo("CN=OCSPECDSATEST",                    "OCSPECDSATEST", SecConst.CA_ACTIVE,                    "", SecConst.CERTPROFILE_FIXED_ROOTCA,                    365,                    null, // Expiretime                    CAInfo.CATYPE_X509,                    CAInfo.SELFSIGNED,                    (Collection) null,                    catokeninfo,                    "JUnit ECDSA CA",                    -1, null,                    "2.5.29.32.0", // PolicyId                    24, // CRLPeriod                    0, // CRLIssueInterval                    10, // CRLOverlapTime                    new ArrayList(),                    true, // Authority Key Identifier                    false, // Authority Key Identifier Critical                    true, // CRL Number                    false, // CRL Number Critical                    null, // defaultcrldistpoint                     null, // defaultocsplocator                    true, // Finish User                    extendedcaservices,                    false, // use default utf8 settings                    new ArrayList(), // Approvals Settings                    1); // Number of Req approvals                cacheAdmin.createCA(admin, cainfo);            CAInfo info = cacheAdmin.getCAInfo(admin, "OCSPECDSATEST");            X509Certificate cert = (X509Certificate) info.getCertificateChain().iterator().next();            assertTrue("Error in created ca certificate", cert.getSubjectDN().toString().equals("CN=OCSPECDSATEST"));            assertTrue("Creating CA failed", info.getSubjectDN().equals("CN=OCSPECDSATEST"));            PublicKey pk = cert.getPublicKey();            if (pk instanceof JCEECPublicKey) {				JCEECPublicKey ecpk = (JCEECPublicKey) pk;				assertEquals(ecpk.getAlgorithm(), "EC");				org.bouncycastle.jce.spec.ECParameterSpec spec = ecpk.getParameters();				assertNotNull("ImplicitlyCA must have null spec", spec);			} else {				assertTrue("Public key is not EC", false);			}            ret = true;            Collection coll = info.getCertificateChain();            Object[] certs = coll.toArray();            cacert = (X509Certificate)certs[0];        } catch (CAExistsException pee) {            log.info("CA exists.");        }        assertTrue("Creating ECDSA CA failed", ret);        log.debug("<addECDSACA()");        return cacert;    }