2 * Copyright 2001-2009 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/signature/ContentReference.h
20 * SAML-specific signature reference profile.
23 #ifndef __saml_sigref_h__
24 #define __saml_sigref_h__
26 #include <saml/base.h>
31 # include <xmltooling/unicode.h>
33 #include <xmltooling/signature/ContentReference.h>
35 namespace xmltooling {
36 class XMLTOOL_API Namespace;
37 class XMLTOOL_API XMLObject;
42 class SAML_API SignableObject;
44 #if defined (_MSC_VER)
45 #pragma warning( push )
46 #pragma warning( disable : 4251 )
50 * SAML-specific signature reference profile.
52 class SAML_API ContentReference : public virtual xmlsignature::ContentReference
58 * @param signableObject reference to object being signed
60 ContentReference(const SignableObject& signableObject);
62 virtual ~ContentReference();
65 * Given a "blank" native signature, creates signature reference
66 * appropriate for the SAML object being signed.
68 * @param sig native signature interface
70 virtual void createReferences(DSIGSignature* sig);
73 * Adds a namespace prefix for "inclusive" processing by an
74 * Exclusive C14N Transform applied to the object.
75 * An empty string will be transformed into "#default".
77 * @param prefix the prefix to add
79 void addInclusivePrefix(const XMLCh* prefix);
82 * Sets the digest algorithm for the signature reference,
85 * @param digest the digest algorithm
87 void setDigestAlgorithm(const XMLCh* digest);
90 * Sets the canonicalization method to include in the reference,
93 * @param c14n the canonicalization method
95 void setCanonicalizationMethod(const XMLCh* c14n);
98 void addPrefixes(const std::set<xmltooling::Namespace>& namespaces);
99 void addPrefixes(const xmltooling::XMLObject& xmlObject);
101 const SignableObject& m_signableObject;
103 std::set<xmltooling::xstring> m_prefixes;
105 std::set<std::string> m_prefixes;
107 const XMLCh* m_digest;
111 #if defined (_MSC_VER)
112 #pragma warning( pop )
116 #endif /* __saml_sigref_h__ */