Multi-line svn commit, see body.
[shibboleth/cpp-xmltooling.git] / xmltoolingtest / FilesystemCredentialResolverTest.h
index a1ba6f3..4f358a8 100644 (file)
@@ -16,7 +16,8 @@
 
 #include "XMLObjectBaseTestCase.h"
 
-#include <xmltooling/signature/CredentialResolver.h>
+#include <xmltooling/security/CredentialResolver.h>
+#include <xmltooling/security/X509Credential.h>
 
 #include <fstream>
 
@@ -41,8 +42,10 @@ public:
             );
 
         Locker locker(credResolver.get());
-        auto_ptr<XSECCryptoKey> key(credResolver->getKey());
-        TSM_ASSERT("Retrieved key was null", key.get()!=NULL);
-        TSM_ASSERT_EQUALS("Unexpected number of certificates", 1, credResolver->getCertificates().size());
+        const X509Credential* cred=dynamic_cast<const X509Credential*>(credResolver->resolve());
+        TSM_ASSERT("Retrieved credential was null", cred!=NULL);
+        TSM_ASSERT("Retrieved key was null", cred->getPrivateKey()!=NULL);
+        TSM_ASSERT_EQUALS("Unexpected number of certificates", 1, cred->getEntityCertificateChain().size());
+        TSM_ASSERT_EQUALS("Custom key name not found", 1, cred->getKeyNames().count("Sample Key"));
     }
 };