// Look for extension OIDs
Iterator iter = m_extensionOids.iterator();
while (iter.hasNext()) {
String oidstr = (String)iter.next();
DERObjectIdentifier oid = new DERObjectIdentifier(oidstr);
X509Extensions reqexts = req.getRequestExtensions();
if (reqexts != null) {
X509Extension ext = reqexts.getExtension(oid);
if (null != ext) {
// We found an extension, call the extenstion class
if (m_log.isDebugEnabled()) {
m_log.debug("Found OCSP extension oid: "+oidstr);
}
IOCSPExtension extObj = (IOCSPExtension)m_extensionMap.get(oidstr);
if (extObj != null) {
// Find the certificate from the certId
X509Certificate cert = null;
cert = (X509Certificate)this.data.certificateStoreSession.findCertificateByIssuerAndSerno(this.data.m_adm, cacert.getSubjectDN().getName(), certId.getSerialNumber());
if (cert != null) {
// Call the OCSP extension
Hashtable retext = extObj.process(request, cert, certStatus);
if (retext != null) {
// Add the returned X509Extensions to the responseExtension we will add to the basic OCSP response
responseExtensions.putAll(retext);
} else {
String errMsg = intres.getLocalizedMessage("ocsp.errorprocessextension", extObj.getClass().getName(), new Integer(extObj.getLastErrorCode()));
m_log.error(errMsg);
}
}
}
}
}
}
} // end of huge for loop
if (cacert != null) {
// Add responseExtensions
X509Extensions exts = new X509Extensions(responseExtensions);
// generate the signed response object
BasicOCSPResp basicresp = signOCSPResponse(req, responseList, exts, cacert);
ocspresp = res.generate(OCSPRespGenerator.SUCCESSFUL, basicresp);
auditLogger.paramPut(IAuditLogger.STATUS, OCSPRespGenerator.SUCCESSFUL);
transactionLogger.paramPut(ITransactionLogger.STATUS, OCSPRespGenerator.SUCCESSFUL);