X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsignature%2FContentReference.h;h=1a197e8264aeb4dd5871c93818b1b3e0f2812564;hb=c072b75e6f6e05e24a1c35b952008b38d0d375c1;hp=f85a906b41c61a379bfc0e921fea4b3eb038affb;hpb=932cfaae2176c2eba1a9938dc420591a9551a7f3;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/signature/ContentReference.h b/saml/signature/ContentReference.h index f85a906..1a197e8 100644 --- a/saml/signature/ContentReference.h +++ b/saml/signature/ContentReference.h @@ -24,14 +24,21 @@ #define __saml_sigref_h__ #include +#include #include +#include #include namespace opensaml { class SAML_API SignableObject; +#if defined (_MSC_VER) + #pragma warning( push ) + #pragma warning( disable : 4251 ) +#endif + /** * SAML-specific signature reference profile. */ @@ -43,7 +50,8 @@ namespace opensaml { * * @param signableObject reference to object being signed */ - ContentReference(const SignableObject& signableObject) : m_signableObject(signableObject) { + ContentReference(const SignableObject& signableObject) + : m_signableObject(signableObject), m_digest(NULL), m_c14n(NULL) { } virtual ~ContentReference() {} @@ -57,24 +65,51 @@ namespace opensaml { virtual void createReferences(DSIGSignature* sig); /** - * Adds a namespace prefix for "inclusive" processing by the + * Adds a namespace prefix for "inclusive" processing by an * Exclusive C14N Transform applied to the object. * An empty string will be transformed into "#default". * * @param prefix the prefix to add */ - void addInclusivePrefix(const char* prefix) { - m_prefixes.push_back(prefix); + void addInclusivePrefix(const XMLCh* prefix); + + /** + * Sets the digest algorithm for the signature reference, + * using a constant. + * + * @param digest the digest algorithm + */ + void setDigestAlgorithm(const XMLCh* digest) { + m_digest = digest; } - protected: - /** Reference to object to sign. */ - const SignableObject& m_signableObject; + /** + * Sets the canonicalization method to include in the reference, + * using a constant. + * + * @param c14n the canonicalization method + */ + void setCanonicalizationMethod(const XMLCh* c14n) { + m_c14n = c14n; + } + + private: + void addPrefixes(const std::set& namespaces); + void addPrefixes(const xmltooling::XMLObject& xmlObject); - /** Inclusive prefixes. */ - std::vector m_prefixes; + const SignableObject& m_signableObject; +#ifdef HAVE_GOOD_STL + std::set m_prefixes; +#else + std::set m_prefixes; +#endif + const XMLCh* m_digest; + const XMLCh* m_c14n; }; +#if defined (_MSC_VER) + #pragma warning( pop ) +#endif }; #endif /* __saml_sigref_h__ */