}
public static BasicOCSPResp generateBasicOCSPResp(OCSPCAServiceRequest serviceReq, String sigAlg, X509Certificate signerCert, PrivateKey signerKey, String provider, X509Certificate[] chain, int respIdType)
throws NotSupportedException, OCSPException, NoSuchProviderException, IllegalArgumentException {
BasicOCSPResp returnval = null;
BasicOCSPRespGenerator basicRes = null;
basicRes = OCSPUtil.createOCSPResponse(serviceReq.getOCSPrequest(), signerCert, respIdType);
ArrayList responses = serviceReq.getResponseList();
if (responses != null) {
Iterator iter = responses.iterator();
while (iter.hasNext()) {
OCSPResponseItem item = (OCSPResponseItem)iter.next();
basicRes.addResponse(item.getCertID(), item.getCertStatus(), item.getThisUpdate(), item.getNextUpdate(), null);
}
}
X509Extensions exts = serviceReq.getExtensions();
if (exts != null) {
Enumeration oids = exts.oids();
if (oids.hasMoreElements()) {
basicRes.setResponseExtensions(exts);
}
}
returnval = basicRes.generate(sigAlg, signerKey, chain, new Date(), provider );
if (m_log.isDebugEnabled()) {
m_log.debug("Signing OCSP response with OCSP signer cert: " + signerCert.getSubjectDN().getName());
RespID respId = null;
if (respIdType == OcspConfiguration.RESPONDERIDTYPE_NAME) {
respId = new RespID(signerCert.getSubjectX500Principal());