throw new ExtendedCAServiceNotActiveException();
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 OCSPCAServiceRequest)) {            throw new IllegalExtendedCAServiceRequestException();                    }        if (this.getStatus() != ExtendedCAServiceInfo.STATUS_ACTIVE) {            throw new ExtendedCAServiceNotActiveException();                                    }        ExtendedCAServiceResponse returnval = null;        OCSPCAServiceRequest ocspServiceReq = (OCSPCAServiceRequest)request;        List certChain = ocspcertificatechain;        if (ocspServiceReq.getCertificateChain() != null) {        	m_log.debug("Using cert chain from CA");        	certChain = ocspServiceReq.getCertificateChain();        }    	X509Certificate signerCert = (X509Certificate)certChain.get(0);        String sigAlg = ocspServiceReq.getSigAlg();        String[] algs = StringUtils.split(sigAlg, ';');        if ( (algs != null) && (algs.length > 1) ) {        	PublicKey pk = signerCert.getPublicKey();        	if (pk instanceof RSAPublicKey) {        		if (StringUtils.contains(algs[0], CATokenConstants.KEYALGORITHM_RSA)) {        			sigAlg = algs[0];        		}        		if (StringUtils.contains(algs[1], CATokenConstants.KEYALGORITHM_RSA)) {        			sigAlg = algs[1];        		}        	} else if (pk instanceof JCEECPublicKey) {        		if (StringUtils.contains(algs[0], CATokenConstants.KEYALGORITHM_ECDSA)) {        			sigAlg = algs[0];        		}        		if (StringUtils.contains(algs[1], CATokenConstants.KEYALGORITHM_ECDSA)) {        			sigAlg = algs[1];        		}        	}        	m_log.debug("Using signature algorithm for response: "+sigAlg);        }        boolean includeChain = ocspServiceReq.includeChain();        X509Certificate[] chain = null;        if (includeChain) {            chain = (X509Certificate[])certChain.toArray(new X509Certificate[0]);        }                try {        	PrivateKey privKey = this.ocspsigningkey;        	if (ocspServiceReq.getPrivKey() != null) {            	m_log.debug("Using private key from CA");        		privKey = ocspServiceReq.getPrivKey();        	}        	BasicOCSPResp ocspresp = OCSPUtil.generateBasicOCSPResp(ocspServiceReq, sigAlg, signerCert, privKey, ocspServiceReq.getPrivKeyProvider(), chain);            returnval = new OCSPCAServiceResponse(ocspresp, chain == null ? null : Arrays.asList(chain));                     } catch (OCSPException ocspe) {            throw new ExtendedCAServiceRequestException(ocspe);        } catch (NoSuchProviderException nspe) {            throw new ExtendedCAServiceRequestException(nspe);                    } catch (NotSupportedException e) {        	m_log.error("Request type not supported: ", e);        	throw new IllegalExtendedCAServiceRequestException(e);		} catch (IllegalArgumentException e) {        	m_log.error("IllegalArgumentException: ", e);        	throw new IllegalExtendedCAServiceRequestException(e);		}        m_log.debug("<extendedService");		  				return returnval;	}