boolean retval = false; Collection extendedServiceTypes = getExternalCAServiceTypes(); if (!extendedServiceTypes.contains(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE))){  String keytype = CATokenConstants.KEYALGORITHM_RSA; String keyspec = "2048";  XKMSCAServiceInfo xKMSCAInfo =  new XKMSCAServiceInfo(ExtendedCAServiceInfo.STATUS_INACTIVE, "CN=XKMSCertificate, " + data.get(SUBJECTDN), "", keyspec, keytype);  XKMSCAService xkmsservice = new XKMSCAService(xKMSCAInfo); try { xkmsservice.init(this); retval = true; } catch (Exception e) { CAInfo info = this.getCAInfo(); String caname = null; if (info != null) { caname = info.getName(); } log.error(intres.getLocalizedMessage("signsession.errorupgradingxkmsservice",caname), e); } setExtendedCAService(xkmsservice); extendedServiceTypes.add(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE)); data.put(EXTENDEDCASERVICES, extendedServiceTypes); } return retval; }
boolean retval = false; Collection extendedServiceTypes = getExternalCAServiceTypes();   if (!extendedServiceTypes.contains(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE))){  String keytype = CATokenConstants.KEYALGORITHM_RSA; String keyspec = "2048";  XKMSCAServiceInfo xKMSCAInfo =  new XKMSCAServiceInfo(ExtendedCAServiceInfo.STATUS_INACTIVE, "CN=XKMSCertificate, " + getSubjectDN(), "", keyspec, keytype);  XKMSCAService xkmsservice = new XKMSCAService(xKMSCAInfo); try { xkmsservice.init(this); retval = true; } catch (Exception e) { CAInfo info = this.getCAInfo(); String caname = null; if (info != null) { caname = info.getName(); } log.error(intres.getLocalizedMessage("signsession.errorupgradingxkmsservice",caname), e); } setExtendedCAService(xkmsservice); extendedServiceTypes.add(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE)); data.put(EXTENDEDCASERVICES, extendedServiceTypes); }   if (!extendedServiceTypes.contains(new Integer(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE))){  String keytype = CATokenConstants.KEYALGORITHM_RSA; String keyspec = "2048";  CmsCAServiceInfo cmsCAInfo =  new CmsCAServiceInfo(ExtendedCAServiceInfo.STATUS_INACTIVE, "CN=CMSCertificate, " + getSubjectDN(), "", keyspec, keytype);  CmsCAService cmsservice = new CmsCAService(cmsCAInfo); try { cmsservice.init(this); retval = true; } catch (Exception e) { CAInfo info = this.getCAInfo(); String caname = null; if (info != null) { caname = info.getName(); } log.error(intres.getLocalizedMessage("signsession.errorupgradingcmsservice",caname), e); } setExtendedCAService(cmsservice); extendedServiceTypes.add(new Integer(ExtendedCAServiceInfo.TYPE_CMSEXTENDEDSERVICE)); data.put(EXTENDEDCASERVICES, extendedServiceTypes); }  return retval; }
	public boolean upgradeExtendedCAServices() {		boolean retval = false;        Collection extendedServiceTypes = getExternalCAServiceTypes();        if (!extendedServiceTypes.contains(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE))){        	        	String keytype = CATokenConstants.KEYALGORITHM_RSA;        	String keyspec = "2048";        	        	XKMSCAServiceInfo xKMSCAInfo =  new XKMSCAServiceInfo(ExtendedCAServiceInfo.STATUS_INACTIVE,                   "CN=XKMSCertificate, " + data.get(SUBJECTDN),                   "",                   keyspec,                   keytype);        	           XKMSCAService xkmsservice = new XKMSCAService(xKMSCAInfo);           try {        	   xkmsservice.init(this);        	   retval = true;           } catch (Exception e) {        	   CAInfo info = this.getCAInfo();        	   String caname = null;        	   if (info != null) {        		   caname = info.getName();        	   }        	   log.error(intres.getLocalizedMessage("signsession.errorupgradingxkmsservice",caname), e);           } 		   setExtendedCAService(xkmsservice); 		   extendedServiceTypes.add(new Integer(ExtendedCAServiceInfo.TYPE_XKMSEXTENDEDSERVICE)); 		   data.put(EXTENDEDCASERVICES, extendedServiceTypes);        }		        return retval;	}