Change license header, remove stale pkg files.
[shibboleth/cpp-opensaml.git] / saml / signature / ContentReference.h
1 /**
2  * Licensed to the University Corporation for Advanced Internet
3  * Development, Inc. (UCAID) under one or more contributor license
4  * agreements. See the NOTICE file distributed with this work for
5  * additional information regarding copyright ownership.
6  *
7  * UCAID licenses this file to you under the Apache License,
8  * Version 2.0 (the "License"); you may not use this file except
9  * in compliance with the License. You may obtain a copy of the
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17  * either express or implied. See the License for the specific
18  * language governing permissions and limitations under the License.
19  */
20
21 /**
22  * @file saml/signature/ContentReference.h
23  * 
24  * SAML-specific signature reference profile.
25  */
26
27 #ifndef __saml_sigref_h__
28 #define __saml_sigref_h__
29
30 #include <saml/base.h>
31
32 #include <set>
33 #include <string>
34 #include <xmltooling/unicode.h>
35 #include <xmltooling/signature/ContentReference.h>
36
37 namespace xmltooling {
38     class XMLTOOL_API Namespace;
39     class XMLTOOL_API XMLObject;
40 };
41
42 namespace opensaml {
43
44     class SAML_API SignableObject;
45
46 #if defined (_MSC_VER)
47     #pragma warning( push )
48     #pragma warning( disable : 4251 )
49 #endif
50
51     /**
52      * SAML-specific signature reference profile.
53      */
54     class SAML_API ContentReference : public virtual xmlsignature::ContentReference
55     {
56     public:
57         /**
58          * Constructor.
59          * 
60          * @param signableObject    reference to object being signed
61          */
62         ContentReference(const SignableObject& signableObject);
63     
64         virtual ~ContentReference();
65
66         /**
67          * Given a "blank" native signature, creates signature reference
68          * appropriate for the SAML object being signed.
69          * 
70          * @param sig   native signature interface
71          */
72         virtual void createReferences(DSIGSignature* sig);
73         
74         /**
75          * Adds a namespace prefix for "inclusive" processing by an
76          * Exclusive C14N Transform applied to the object.
77          * An empty string will be transformed into "#default".
78          * 
79          * @param prefix    the prefix to add 
80          */
81         void addInclusivePrefix(const XMLCh* prefix);
82         
83         /**
84          * Sets the digest algorithm for the signature reference,
85          * using a constant.
86          * 
87          * @param digest    the digest algorithm
88          */
89         void setDigestAlgorithm(const XMLCh* digest);
90
91         /**
92          * Sets the canonicalization method to include in the reference,
93          * using a constant.
94          * 
95          * @param c14n  the canonicalization method
96          */
97         void setCanonicalizationMethod(const XMLCh* c14n);
98         
99     private:
100         const SignableObject& m_signableObject;
101         std::set<xmltooling::xstring> m_prefixes;
102         const XMLCh* m_digest;
103         const XMLCh* m_c14n;
104     };
105
106 #if defined (_MSC_VER)
107     #pragma warning( pop )
108 #endif
109 };
110
111 #endif /* __saml_sigref_h__ */