CA ca = (CA) cadata.getCA();
CA ca = cadata.getCA();
    public void editCA(Admin admin, CAInfo cainfo) throws AuthorizationDeniedException{        boolean ocsprenewcert = false;        // Check authorization        try{            getAuthorizationSession().isAuthorizedNoLog(admin,"/super_administrator");        }catch(AuthorizationDeniedException e){            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,"Administrator isn't authorized to edit CA",e);            throw new AuthorizationDeniedException("Not authorized to edit CA with caid = " + cainfo.getCAId());        }        // Check if OCSP Certificate is about to be renewed.        Iterator iter = cainfo.getExtendedCAServiceInfos().iterator();        while(iter.hasNext()){          Object next = iter.next();          if(next instanceof OCSPCAServiceInfo)            ocsprenewcert = ((OCSPCAServiceInfo) next).getRenewFlag();        }        // Get CA from database        try{            CADataLocal cadata = cadatahome.findByPrimaryKey(new Integer(cainfo.getCAId()));            CA ca = (CA) cadata.getCA();            // Update CA values            ca.updateCA(cainfo);            // Store CA in database            cadata.setCA(ca);            // If OCSP Certificate renew, publish the new one.            if(ocsprenewcert){              X509Certificate ocspcert = (X509Certificate) ((OCSPCAServiceInfo)                                         ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_OCSPEXTENDEDSERVICE))                                         .getOCSPSignerCertificatePath().get(0);			  ArrayList ocspcertificate = new ArrayList();              ocspcertificate.add(ocspcert);              getSignSession().publishCACertificate(admin, ocspcertificate, ca.getCRLPublishers(), CertificateDataBean.CERTTYPE_ENDENTITY);            }            // Log Action            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_INFO_CAEDITED,"");        }catch(Exception fe) {            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_CAEDITED,"Couldn't Edit CA.",fe);            throw new EJBException(fe);        }    } // editCA