Integrated credential resolver API with signing context.
[shibboleth/xmltooling.git] / xmltoolingtest / SignatureTest.h
index 62009ed..62bd6a3 100644 (file)
@@ -24,7 +24,7 @@
 #include <xsec/enc/OpenSSL/OpenSSLCryptoX509.hpp>\r
 #include <xsec/enc/OpenSSL/OpenSSLCryptoKeyRSA.hpp>\r
 \r
-class TestContext : public SigningContext, public VerifyingContext\r
+class TestContext : public SigningContext, public VerifyingContext, CredentialResolver\r
 {\r
     XSECCryptoKey* m_key;\r
     vector<XSECCryptoX509*> m_certs;\r
@@ -65,10 +65,11 @@ public:
         XMLString::release(&m_uri);\r
     }\r
 \r
-    void createSignature(DSIGSignature* sig) const {\r
+    bool createSignature(DSIGSignature* sig) {\r
         DSIGReference* ref=sig->createReference(m_uri);\r
         ref->appendEnvelopedSignatureTransform();\r
         ref->appendCanonicalizationTransform(CANON_C14NE_NOC);\r
+        return false;\r
     }\r
 \r
     void verifySignature(DSIGSignature* sig) const {\r
@@ -79,9 +80,14 @@ public:
         sig->verify();\r
     }\r
     \r
-    const std::vector<XSECCryptoX509*>* getX509Certificates() const { return &m_certs; }\r
-    KeyInfo* getKeyInfo() const { return NULL; }\r
-    XSECCryptoKey* getSigningKey() const { return m_key->clone(); }\r
+    KeyInfo* getKeyInfo() { return NULL; }\r
+    CredentialResolver& getCredentialResolver() { return *this; }\r
+    const char* getId() const { return "test"; }\r
+    const std::vector<XSECCryptoX509*>* getX509Certificates() { return &m_certs; }\r
+    XSECCryptoKey* getPublicKey() { return m_key; }\r
+    XSECCryptoKey* getPrivateKey() { return m_key; }\r
+    Lockable& lock() { return *this; }\r
+    void unlock() {}\r
 };\r
 \r
 class SignatureTest : public CxxTest::TestSuite {\r