- const EntityDescriptor* sp = m_metadata->getEntityDescriptor("https://sp.example.org/");
- TSM_ASSERT("No metadata for recipient.", sp!=NULL);
- const SPSSODescriptor* sprole = sp->getSPSSODescriptor(samlconstants::SAML20P_NS);
- TSM_ASSERT("No SP role for recipient.", sprole!=NULL);
- MetadataCredentialCriteria mcc(*sprole);
+ MetadataProvider::Criteria mc("https://sp.example.org/", &SPSSODescriptor::ELEMENT_QNAME, samlconstants::SAML20P_NS);
+ pair<const EntityDescriptor*,const RoleDescriptor*> sp = m_metadata->getEntityDescriptor(mc);
+ TSM_ASSERT("No metadata for recipient.", sp.first!=nullptr);
+ TSM_ASSERT("No SP role for recipient.", sp.second!=nullptr);
+ MetadataCredentialCriteria mcc(*sp.second);