#include "internal.h"
#include "exceptions.h"
+#include "logging.h"
#include "impl/UnknownElement.h"
#include "security/Credential.h"
#include "signature/KeyInfo.h"
#include "util/XMLConstants.h"
#include "util/XMLHelper.h"
-#include <log4cpp/Category.hh>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/framework/Wrapper4InputSource.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xsec/transformers/TXFMOutputFile.hpp>
using namespace xmlsignature;
+using namespace xmltooling::logging;
using namespace xmltooling;
-using namespace log4cpp;
using namespace std;
using xmlconstants::XMLSIG_NS;
using xmlconstants::XMLSIG_PREFIX;
if (credential) {
delete m_keyInfo;
m_keyInfo = NULL;
- const KeyInfo* fromcred = credential->getKeyInfo();
- if (fromcred)
- m_keyInfo = fromcred->cloneKeyInfo();
+ m_keyInfo = credential->getKeyInfo();
}
if (m_keyInfo && (!m_signature->getKeyInfoList() || m_signature->getKeyInfoList()->isEmpty())) {
m_keyInfo->marshall(cachedDOM);
if (credential) {
delete m_keyInfo;
m_keyInfo = NULL;
- const KeyInfo* fromcred = credential->getKeyInfo();
- if (fromcred)
- m_keyInfo = fromcred->cloneKeyInfo();
+ m_keyInfo = credential->getKeyInfo();
}
if (m_keyInfo && (!m_signature->getKeyInfoList() || m_signature->getKeyInfoList()->isEmpty())) {
m_keyInfo->marshall(cachedDOM);
throw SignatureException(string("Caught an XMLSecurity exception while verifying raw signature: ") + e.getMsg());
}
}
+
+void Signature::extractNames(DSIGKeyInfoList* keyInfo, set<string>& names)
+{
+ char* kn;
+ const XMLCh* n;
+
+ for (size_t s=0; s<keyInfo->getSize(); s++) {
+ n=keyInfo->item(s)->getKeyName();
+ if (n && *n) {
+ kn=toUTF8(n);
+ names.insert(kn);
+ delete[] kn;
+ }
+ }
+}