Merged trust engines back into a unified version, made metadata roles a "KeyInfoSource".
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / impl / MetadataImpl.cpp
index 372a34a..d2fea81 100644 (file)
@@ -23,6 +23,7 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "saml2/metadata/Metadata.h"
+#include "saml2/metadata/MetadataKeyInfoIterator.h"
 
 #include <xmltooling/AbstractComplexElement.h>
 #include <xmltooling/AbstractElementProxy.h>
@@ -956,6 +957,23 @@ namespace opensaml {
                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
             }
             
+            KeyInfoIterator* getKeyInfoIterator() const {
+                return new MetadataKeyInfoIterator(*this);
+            }
+
+            std::string getName() const {
+                const EntityDescriptor* parent = dynamic_cast<const EntityDescriptor*>(getParent());
+                if (parent) {
+                    char* ch = toUTF8(parent->getEntityID());
+                    if (ch) {
+                        string s(ch);
+                        delete[] ch;
+                        return s;
+                    }
+                }
+                return "";
+            }
+            
             IMPL_ID_ATTRIB(ID);
             IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
             IMPL_STRING_ATTRIB(ErrorURL);