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); } 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); }
    public void upgrade(){    	if(Float.compare(LATEST_VERSION, getVersion()) != 0) {            // New version of the class, upgrade            log.info("Upgrading X509CA with version "+getVersion());            if (data.get(DEFAULTOCSPSERVICELOCATOR) == null) {                setDefaultCRLDistPoint("");                setDefaultOCSPServiceLocator("");            }            if (data.get(CRLISSUEINTERVAL) == null) {                setCRLIssueInterval(0);            }            if (data.get(CRLOVERLAPTIME) == null) {            	// Default value 10 minutes            	setCRLOverlapTime(10);            }            if (data.get("alwaysuseutf8subjectdn") == null) {            	// Default value false            	setUseUTF8PolicyText(false);            } else {            	// Use the same value as we had before when we had alwaysuseutf8subjectdn                boolean useutf8 = ((Boolean)data.get("alwaysuseutf8subjectdn")).booleanValue();            	setUseUTF8PolicyText(useutf8);            }            if (data.get(DEFAULTCRLISSUER) == null) {            	setDefaultCRLIssuer(null);            }                        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);               } 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);            }                        data.put(VERSION, new Float(LATEST_VERSION));        }      }