Multi-line svn commit, see body.
[shibboleth/cpp-opensaml.git] / saml / binding / MessageEncoder.h
index b60dfb2..0bb70ee 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <istream>
 #include <xmltooling/XMLObject.h>
-#include <xmltooling/signature/CredentialResolver.h>
+#include <xmltooling/security/Credential.h>
 
 namespace opensaml {
 
@@ -46,6 +46,15 @@ namespace opensaml {
         virtual ~MessageEncoder() {}
 
         /**
+         * Indicates whether the encoding format requires that messages be as compact as possible.
+         *
+         * @return  true iff the encoding has size constraints
+         */
+        virtual bool isCompact() const {
+            return false;
+        }
+
+        /**
          * Interface to caller-supplied artifact generation mechanism.
          * 
          * Generating an artifact for storage and retrieval requires knowledge of
@@ -107,8 +116,9 @@ namespace opensaml {
          * @param destination       destination URL for message
          * @param recipientID       optional entityID of message recipient
          * @param relayState        optional RelayState value to accompany message
-         * @param credResolver      optional CredentialResolver instance to supply signing material
-         * @param sigAlgorithm      optional signature algorithm identifier
+         * @param credential        optional Credential to supply signing key
+         * @param signatureAlg      optional signature algorithm identifier
+         * @param digestAlg         optional reference digest algorithm identifier
          */
         virtual long encode(
             GenericResponse& genericResponse,
@@ -116,26 +126,14 @@ namespace opensaml {
             const char* destination,
             const char* recipientID=NULL,
             const char* relayState=NULL,
-            const xmlsignature::CredentialResolver* credResolver=NULL,
-            const XMLCh* sigAlgorithm=NULL
+            const xmltooling::Credential* credential=NULL,
+            const XMLCh* signatureAlg=NULL,
+            const XMLCh* digestAlg=NULL
             ) const=0;
 
     protected:
         MessageEncoder() : m_artifactGenerator(NULL) {}
         
-        /**
-         * Helper function to build a new XML Signature with KeyInfo, based
-         * on the supplied CredentialResolver.
-         * 
-         * @param credResolver      CredentialResolver instance to supply signing material
-         * @param sigAlgorithm      optional signature algorithm identifier
-         * @return  a new Signature object
-         */
-        xmlsignature::Signature* buildSignature(
-            const xmlsignature::CredentialResolver* credResolver,
-            const XMLCh* sigAlgorithm=NULL
-            ) const;
-        
         /** Pointer to an ArtifactGenerator implementation. */
         const ArtifactGenerator* m_artifactGenerator;
     };