Add credential context APIs, refactor criteria matching, auto-extract criteria from...
[shibboleth/cpp-xmltooling.git] / xmltooling / signature / impl / XMLSecSignatureImpl.cpp
index 57ab8bc..388ceb0 100644 (file)
@@ -533,3 +533,18 @@ bool Signature::verifyRawSignature(
         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;
+        }
+    }
+}