Refactored Signature signing/validation, various Validator bugs fixed.
[shibboleth/cpp-xmltooling.git] / xmltooling / XMLObject.h
index d32d155..ed750ce 100644 (file)
@@ -35,7 +35,6 @@ using namespace xercesc;
 #ifndef XMLTOOLING_NO_XMLSEC\r
 namespace xmlsignature {\r
     class XMLTOOL_API Signature;\r
-    class XMLTOOL_API SigningContext;\r
 };\r
 #endif\r
 \r
@@ -47,36 +46,6 @@ namespace xmlsignature {
 namespace xmltooling {\r
 \r
     /**\r
-     * Supplies additional information to the marshalling process.\r
-     * Currently this only consists of signature related information.\r
-     */\r
-    class XMLTOOL_API MarshallingContext\r
-    {\r
-        MAKE_NONCOPYABLE(MarshallingContext);\r
-    public:\r
-        /**\r
-         * Default constructor.\r
-         */\r
-        MarshallingContext() {}\r
-        ~MarshallingContext() {}\r
-\r
-#ifndef XMLTOOLING_NO_XMLSEC\r
-        /**\r
-         * Builds a marshalling context with an initial signature/context pair.\r
-         * \r
-         * @param sig   a signature object\r
-         * @param ctx   the signing context to associate with the signature \r
-         */\r
-        MarshallingContext(xmlsignature::Signature* sig, xmlsignature::SigningContext* ctx) {\r
-            m_signingContexts.push_back(std::make_pair(sig,ctx));\r
-        }\r
-        \r
-        /** Array of signing contexts, keyed off of the associated Signature */\r
-        std::vector< std::pair<xmlsignature::Signature*,xmlsignature::SigningContext*> > m_signingContexts;\r
-#endif\r
-    };\r
-\r
-    /**\r
      * Object that represents an XML Element that has been unmarshalled into this C++ object.\r
      */\r
     class XMLTOOL_API XMLObject\r
@@ -244,13 +213,18 @@ namespace xmltooling {
          * marshalled, unless an existing DOM can be reused without creating a new document. \r
          * \r
          * @param document  the DOM document the marshalled element will be placed in, or NULL\r
-         * @param ctx       optional marshalling context\r
+         * @param sigs      ordered array of signatures to create after marshalling is complete\r
          * @return the DOM element representing this XMLObject\r
          * \r
          * @throws MarshallingException thrown if there is a problem marshalling the given object\r
          * @throws SignatureException thrown if a problem occurs during signature creation \r
          */\r
-        virtual DOMElement* marshall(DOMDocument* document=NULL, MarshallingContext* ctx=NULL) const=0;\r
+        virtual DOMElement* marshall(\r
+            DOMDocument* document=NULL\r
+#ifndef XMLTOOLING_NO_XMLSEC\r
+            ,const std::vector<xmlsignature::Signature*>* sigs=NULL\r
+#endif\r
+            ) const=0;\r
         \r
         /**\r
          * Marshalls the XMLObject and appends it as a child of the given parent element.\r
@@ -259,13 +233,18 @@ namespace xmltooling {
          * the Document owning the given Element.\r
          * \r
          * @param parentElement the parent element to append the resulting DOM tree\r
-         * @param ctx       optional marshalling context\r
+         * @param sigs          ordered array of signatures to create after marshalling is complete\r
          * @return the marshalled element tree\r
 \r
          * @throws MarshallingException thrown if the given XMLObject can not be marshalled.\r
          * @throws SignatureException thrown if a problem occurs during signature creation \r
          */\r
-        virtual DOMElement* marshall(DOMElement* parentElement, MarshallingContext* ctx=NULL) const=0;\r
+        virtual DOMElement* marshall(\r
+            DOMElement* parentElement\r
+#ifndef XMLTOOLING_NO_XMLSEC\r
+            ,const std::vector<xmlsignature::Signature*>* sigs=NULL\r
+#endif\r
+            ) const=0;\r
 \r
         /**\r
          * Unmarshalls the given W3C DOM element into the XMLObject.\r