if(cmsrenewcert){ X509Certificate cmscert = (X509Certificate) ((CmsCAServiceInfo) ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE)) .getCertificatePath().get(0); ArrayList cmscertificate = new ArrayList(); cmscertificate.add(cmscert); getSignSession().publishCACertificate(admin, cmscertificate, ca.getCRLPublishers(), CertificateDataBean.CERTTYPE_ENDENTITY); }
    public void editCA(Admin admin, CAInfo cainfo) throws AuthorizationDeniedException{        boolean ocsprenewcert = false;        boolean xkmsrenewcert = false;        // Check authorization        try{            getAuthorizationSession().isAuthorizedNoLog(admin,"/super_administrator");        }catch(AuthorizationDeniedException e){    		String msg = intres.getLocalizedMessage("caadmin.notauthorizedtoeditca", cainfo.getName());            	            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,msg,e);            throw new AuthorizationDeniedException(msg);        }        // 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();          }          if(next instanceof XKMSCAServiceInfo){              xkmsrenewcert = ((XKMSCAServiceInfo) next).getRenewFlag();          }        }        // Get CA from database        try{            CADataLocal cadata = cadatahome.findByPrimaryKey(new Integer(cainfo.getCAId()));            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);            }            if(xkmsrenewcert){                X509Certificate xkmscert = (X509Certificate) ((XKMSCAServiceInfo)                                           ca.getExtendedCAServiceInfo(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE))                                           .getXKMSSignerCertificatePath().get(0);  			  ArrayList xkmscertificate = new ArrayList();  			  xkmscertificate.add(xkmscert);              getSignSession().publishCACertificate(admin, xkmscertificate, ca.getCRLPublishers(), CertificateDataBean.CERTTYPE_ENDENTITY);            }            // Log Action    		String msg = intres.getLocalizedMessage("caadmin.editedca", cainfo.getName());            	            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_INFO_CAEDITED, msg);        }catch(Exception fe) {    		String msg = intres.getLocalizedMessage("caadmin.erroreditca", cainfo.getName());            	            log.error(msg, fe);            getLogSession().log(admin, cainfo.getCAId(), LogEntry.MODULE_CA,  new java.util.Date(), null, null, LogEntry.EVENT_ERROR_CAEDITED, msg, fe);            throw new EJBException(fe);        }    } // editCA