#ifndef __saml2_metadataprov_h__
#define __saml2_metadataprov_h__
-#include <xmltooling/Lockable.h>
#include <saml/saml2/metadata/MetadataFilter.h>
+#include <xmltooling/Lockable.h>
+#include <xmltooling/signature/KeyResolver.h>
+
namespace opensaml {
class SAML_API SAMLArtifact;
namespace saml2md {
+
+ class SAML_API EntityDescriptor;
+ class SAML_API EntitiesDescriptor;
/**
* Supplies an individual source of metadata.
protected:
/**
- * Constructor. If a DOM is supplied, a set of default logic will be
- * used to identify and build MetadataFilter plugins and install them
- * into the provider. The following XML content is supported:
+ * Constructor.
+ *
+ * If a DOM is supplied, a set of default logic will be used to identify
+ * and build MetadataFilter plugins and install them into the provider.
+ * A KeyResolver can also be supplied, or a default resolver will be used.
+ *
+ * The following XML content is supported:
*
* <ul>
- * <li><MetadataFilter> elements with a type attribute
+ * <li><KeyResolver> elements with a type attribute
+ * <li><MetadataFilter> elements with a type attribute and type-specific content
* <li><Exclude> elements representing a BlacklistMetadataFilter
* <li><BlacklistMetadataFilter> element containing <Exclude> elements
* <li><Include> elements representing a WhitelistMetadataFilter
+ * <li><SignatureMetadataFilter> element containing a <KeyResolver> element
* <li><WhitelistMetadataFilter> element containing <Include> elements
* </ul>
*
virtual void init()=0;
/**
+ * Returns a KeyResolver associated with this metadata provider, if any.
+ *
+ * @return an associated KeyResolver, or NULL
+ */
+ virtual const xmlsignature::KeyResolver* getKeyResolver() const {
+ return m_resolver;
+ }
+
+ /**
* Gets the entire metadata tree, after the registered filter has been applied.
* The caller MUST unlock the provider when finished with the data.
*
virtual const EntitiesDescriptor* getEntitiesDescriptor(const char* name, bool requireValidMetadata=true) const;
protected:
+ /** Embedded KeyResolver instance. */
+ xmlsignature::KeyResolver* m_resolver;
+
/**
* Applies any installed filters to a metadata instance.
*
/**
* Clear the cache of known entities and groups.
*/
- virtual void clearIndex();
+ virtual void clearDescriptorIndex();
private:
std::vector<MetadataFilter*> m_filters;