+ // Check for KeyInfo, but defensively (we might be able to run without it).
+ KeyInfo* keyInfo=NULL;
+ const char* k = request.getParameter("KeyInfo");
+ if (k) {
+ try {
+ istringstream kstrm(k);
+ DOMDocument* doc = XMLToolingConfig::getConfig().getParser().parse(kstrm);
+ XercesJanitor<DOMDocument> janitor(doc);
+ XMLObject* kxml = XMLObjectBuilder::buildOneFromElement(doc->getDocumentElement(), true);
+ janitor.release();
+ if (!(keyInfo=dynamic_cast<KeyInfo*>(kxml)))
+ delete kxml;
+ }
+ catch (XMLToolingException& ex) {
+ log.warn("Failed to load KeyInfo from message: %s", ex.what());
+ }
+ }
+
+ auto_ptr<KeyInfo> kjanitor(keyInfo);