/*
- * Copyright 2001-2007 Internet2
+ * Copyright 2001-2010 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
auto_ptr_XMLCh path("path");
string s = data_path + "security/example-metadata.xml";
auto_ptr_XMLCh file(s.c_str());
- doc->getDocumentElement()->setAttributeNS(NULL,path.get(),file.get());
+ doc->getDocumentElement()->setAttributeNS(nullptr,path.get(),file.get());
// Build metadata provider.
auto_ptr<MetadataProvider> metadataProvider(
// Build trust engine.
auto_ptr<TrustEngine> trustEngine(
- XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(EXPLICIT_KEY_TRUSTENGINE, NULL)
+ XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(EXPLICIT_KEY_TRUSTENGINE, nullptr)
);
// Get signed assertion.
janitor2.release();
Locker locker(metadataProvider.get());
- const EntityDescriptor* descriptor = metadataProvider->getEntityDescriptor("https://idp.example.org");
- TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=NULL);
+ const EntityDescriptor* descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria("https://idp.example.org")).first;
+ TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=nullptr);
RoleDescriptor* role=descriptor->getIDPSSODescriptors().front();
- TSM_ASSERT("Role not present", role!=NULL);
+ TSM_ASSERT("Role not present", role!=nullptr);
Signature* sig=assertion->getSignature();
- TSM_ASSERT("Signature not present", sig!=NULL);
+ TSM_ASSERT("Signature not present", sig!=nullptr);
MetadataCredentialCriteria cc(*role);
cc.setPeerName("https://idp.example.org");
TSM_ASSERT("Signature failed to validate.", dynamic_cast<SignatureTrustEngine*>(trustEngine.get())->validate(*sig, *metadataProvider, &cc));
- descriptor = metadataProvider->getEntityDescriptor("https://idp2.example.org");
- TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=NULL);
+ descriptor = metadataProvider->getEntityDescriptor(MetadataProvider::Criteria("https://idp2.example.org")).first;
+ TSM_ASSERT("Retrieved entity descriptor was null", descriptor!=nullptr);
role=descriptor->getIDPSSODescriptors().front();
- TSM_ASSERT("Role not present", role!=NULL);
+ TSM_ASSERT("Role not present", role!=nullptr);
MetadataCredentialCriteria cc2(*role);
cc2.setPeerName("https://idp2.example.org");