- 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!=nullptr);
+ TSM_ASSERT("Retrieved key was null", cred->getPrivateKey()!=nullptr);
+ 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"));