Major revamp of credential and trust handling code, PKIX engine still needs work.
[shibboleth/cpp-opensaml.git] / samltest / saml2 / binding / SAML2POSTTest.h
index 776c95f..814873e 100644 (file)
@@ -46,6 +46,12 @@ public:
                 );
             janitor.release();
 
+            CredentialCriteria cc;\r
+            cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL);\r
+            Locker clocker(m_creds);\r
+            const Credential* cred = m_creds->resolve(&cc);\r
+            TSM_ASSERT("Retrieved credential was null", cred!=NULL);\r
+
             // Freshen timestamp and ID.
             toSend->setIssueInstant(time(NULL));
             toSend->setID(NULL);
@@ -64,7 +70,7 @@ public:
                     samlconstants::SAML20_BINDING_HTTP_POST, encoder_config->getDocumentElement()
                     )
                 );
-            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",m_creds);
+            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",cred);
             toSend.release();
             
             // Decode message.
@@ -108,6 +114,12 @@ public:
                 );
             janitor.release();
 
+            CredentialCriteria cc;\r
+            cc.setUsage(CredentialCriteria::SIGNING_CREDENTIAL);\r
+            Locker clocker(m_creds);\r
+            const Credential* cred = m_creds->resolve(&cc);\r
+            TSM_ASSERT("Retrieved credential was null", cred!=NULL);\r
+
             // Freshen timestamp and ID.
             toSend->setIssueInstant(time(NULL));
             toSend->setID(NULL);
@@ -126,7 +138,7 @@ public:
                     samlconstants::SAML20_BINDING_HTTP_POST_SIMPLESIGN, encoder_config->getDocumentElement()
                     )
                 );
-            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",m_creds);
+            encoder->encode(*this,toSend.get(),"https://sp.example.org/SAML/SSO","https://sp.example.org/","state",cred);
             toSend.release();
             
             // Decode message.