m_log.error("XKMS CA Service not activated. Activate it in the Edit CA Page."); throw new ExtendedCAServiceNotActiveException("XKMS CA Service not activated. Activate it in the Edit CA Page.");
String msg = intres.getLocalizedMessage("caservice.notactive"); m_log.error(msg); throw new ExtendedCAServiceNotActiveException(msg);
	public ExtendedCAServiceResponse extendedService(ExtendedCAServiceRequest request) throws ExtendedCAServiceRequestException, IllegalExtendedCAServiceRequestException,ExtendedCAServiceNotActiveException {        m_log.debug(">extendedService");        if (!(request instanceof XKMSCAServiceRequest)) {            throw new IllegalExtendedCAServiceRequestException();                    }        if (this.getStatus() != ExtendedCAServiceInfo.STATUS_ACTIVE) {        	m_log.error("XKMS CA Service not activated. Activate it in the Edit CA Page.");            throw new ExtendedCAServiceNotActiveException("XKMS CA Service not activated. Activate it in the Edit CA Page.");                                    }        ExtendedCAServiceResponse returnval = null;    	X509Certificate signerCert = (X509Certificate) xKMScertificatechain.get(0);        XKMSCAServiceRequest xKMSServiceReq = (XKMSCAServiceRequest)request;                Document doc = xKMSServiceReq.getDoc();        if(xKMSServiceReq.isSign()){        	try{				org.apache.xml.security.signature.XMLSignature xmlSig = new org.apache.xml.security.signature.XMLSignature(doc, "", org.apache.xml.security.signature.XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1, org.apache.xml.security.c14n.Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);				org.apache.xml.security.transforms.Transforms transforms = new org.apache.xml.security.transforms.Transforms(doc);				transforms.addTransform(org.apache.xml.security.transforms.Transforms.TRANSFORM_ENVELOPED_SIGNATURE);				transforms.addTransform(org.apache.xml.security.transforms.Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);				xmlSig.addDocument("#" + xKMSServiceReq.getId(), transforms, org.apache.xml.security.utils.Constants.ALGO_ID_DIGEST_SHA1);        							xmlSig.addKeyInfo(signerCert);				doc.getDocumentElement().insertBefore( xmlSig.getElement() ,doc.getDocumentElement().getFirstChild());				xmlSig.sign(xKMSkey);               		        		        		returnval = new XKMSCAServiceResponse(doc);        	}catch (XMLSignatureException e) {        		throw new ExtendedCAServiceRequestException(e);			} catch (XMLSecurityException e) {				throw new ExtendedCAServiceRequestException(e);			}        }                m_log.debug("<extendedService");		  				return returnval;	}