X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2Fsecurity%2Fimpl%2FInlineKeyResolver.cpp;h=c198b93be8b43177ba372c11068db8b9bcec483d;hp=122aff3ff3c1efea63ead2121039d0858fe2460b;hb=10f9e25bb2f29ec48303b02352166754157100e5;hpb=6cff60610d7503e76dace1c5916cd3c5436ea233 diff --git a/xmltooling/security/impl/InlineKeyResolver.cpp b/xmltooling/security/impl/InlineKeyResolver.cpp index 122aff3..c198b93 100644 --- a/xmltooling/security/impl/InlineKeyResolver.cpp +++ b/xmltooling/security/impl/InlineKeyResolver.cpp @@ -65,8 +65,21 @@ namespace xmltooling { return NULL; } - const KeyInfo* getKeyInfo(bool compact=false) const { - return m_credctx->getKeyInfo(); + KeyInfo* getKeyInfo(bool compact=false) const { + KeyInfo* ret = m_credctx->getKeyInfo() ? m_credctx->getKeyInfo()->cloneKeyInfo() : NULL; + if (ret && compact) { + ret->getKeyValues().clear(); + ret->getSPKIDatas().clear(); + ret->getPGPDatas().clear(); + ret->getUnknownXMLObjects().clear(); + const vector x509Datas=const_cast(ret)->getX509Datas(); + for (vector::const_iterator x=x509Datas.begin(); x!=x509Datas.end(); ++x) { + (*x)->getX509Certificates().clear(); + (*x)->getX509CRLs().clear(); + (*x)->getUnknownXMLObjects().clear(); + } + } + return ret; } const CredentialContext* getCredentialContext() const {