+
+ auto_ptr<KeyInfo> keyInfo(credential->getKeyInfo());
+ if (keyInfo.get()) {
+ string& kstring = pmap.m_map["KeyInfo"];
+ XMLHelper::serialize(keyInfo->marshall((DOMDocument*)NULL), kstring);
+ xsecsize_t len=0;
+ XMLByte* out=Base64::encode(reinterpret_cast<const XMLByte*>(kstring.data()),kstring.size(),&len);
+ if (!out)
+ throw BindingException("Base64 encoding of XML failed.");
+ kstring.erase();
+ kstring.append(reinterpret_cast<char*>(out),len);
+#ifdef OPENSAML_XERCESC_HAS_XMLBYTE_RELEASE
+ XMLString::release(&out);
+#else
+ XMLString::release((char**)&out);
+#endif
+ }