#include <string>\r
#include <xmltooling/XMLObject.h>\r
#include <xmltooling/signature/CredentialResolver.h>\r
-#include <xmltooling/util/StorageService.h>\r
\r
namespace opensaml {\r
\r
virtual ~MessageEncoder() {}\r
\r
/**\r
- * Interface to caller-supplied URL-encoding mechanism.\r
- * \r
- * Since URL-encoding is not canonical, it's important that the same\r
- * encoder is used during some binding-specific signature operations.\r
- */\r
- class SAML_API URLEncoder {\r
- MAKE_NONCOPYABLE(URLEncoder);\r
- protected:\r
- URLEncoder() {}\r
- public:\r
- virtual ~URLEncoder() {}\r
- \r
- /**\r
- * Produce a URL-safe but equivalent version of the input string.\r
- * \r
- * @param s input string to encode\r
- * @return a string object containing the result of encoding the input\r
- */\r
- virtual std::string encode(const char* s) const=0;\r
- };\r
- \r
- /**\r
- * Provides a URLEncoder implementation for the MessageEncoder to use.\r
- * The implementation's lifetime must be longer than the lifetime of this object.\r
- * This method must be externally synchronized. \r
- * \r
- * @param urlEncoder a URLEncoder implementation to use\r
- */\r
- void setURLEncoder(const URLEncoder* urlEncoder) {\r
- m_urlEncoder = urlEncoder;\r
- }\r
-\r
- /**\r
* Interface to caller-supplied artifact generation mechanism.\r
* \r
* Generating an artifact for storage and retrieval requires knowledge of\r
* the sender's SourceID (or sometimes SourceLocation), and the relying party's\r
* preferred artifact type. This information can be supplied using whatever\r
* configuration or defaults are appropriate for the SAML application.\r
- * An ArtifactMap implementation will invoke the supplied generator interface\r
+ * A MessageEncoder implementation will invoke the supplied generator interface\r
* when it requires an artifact be created.\r
*/\r
class SAML_API ArtifactGenerator {\r
) const=0;\r
\r
protected:\r
- MessageEncoder() : m_urlEncoder(NULL), m_artifactGenerator(NULL) {}\r
+ MessageEncoder() : m_artifactGenerator(NULL) {}\r
\r
- /** Pointer to a URLEncoder implementation. */\r
- const URLEncoder* m_urlEncoder;\r
+ /**\r
+ * Helper function to build a new XML Signature with KeyInfo, based\r
+ * on the supplied CredentialResolver.\r
+ * \r
+ * @param credResolver CredentialResolver instance to supply signing material\r
+ * @param sigAlgorithm optional signature algorithm identifier\r
+ * @return a new Signature object\r
+ */\r
+ xmlsignature::Signature* buildSignature(\r
+ const xmlsignature::CredentialResolver* credResolver,\r
+ const XMLCh* sigAlgorithm=NULL\r
+ ) const;\r
\r
/** Pointer to an ArtifactGenerator implementation. */\r
const ArtifactGenerator* m_artifactGenerator;\r
\r
/** MessageEncoder for SAML 1.x Browser/POST "binding" (really part of profile) */\r
#define SAML1_POST_ENCODER "urn:oasis:names:tc:SAML:1.0:profiles:browser-post"\r
+ \r
+ /** MessageEncoder for SAML 2.0 HTTP-Artifact binding */\r
+ #define SAML2_ARTIFACT_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"\r
+\r
+ /** MessageEncoder for SAML 2.0 HTTP-POST binding */\r
+ #define SAML2_POST_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"\r
+\r
+ /** MessageEncoder for SAML 2.0 HTTP-Redirect binding */\r
+ #define SAML2_REDIRECT_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"\r
};\r
\r
#endif /* __saml_encoder_h__ */\r