Fix name of exception control setting.
[shibboleth/cpp-sp.git] / xmlproviders / internal.h
1 /*
2  *  Copyright 2001-2005 Internet2
3  * 
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 /* internal.h
18
19    Scott Cantor
20    2/14/04
21
22    $History:$
23 */
24
25 #ifndef __internal_h__
26 #define __internal_h__
27
28 // eventually we might be able to support autoconf via cygwin...
29 #if defined (_MSC_VER) || defined(__BORLANDC__)
30 # include "config_win32.h"
31 #else
32 # include "config.h"
33 #endif
34
35 #include <saml/saml.h>
36 #include <shib/shib.h>
37 #include <shib/shib-threads.h>
38 #include <openssl/ssl.h>
39
40 #if defined(HAVE_LOG4SHIB)
41 # include <log4shib/Category.hh>
42 # include <log4shib/CategoryStream.hh>
43 namespace xmlproviders {
44     namespace logging = log4shib;
45 };
46 #elif defined(HAVE_LOG4CPP)
47 # include <log4cpp/Category.hh>
48 # include <log4cpp/CategoryStream.hh>
49 namespace xmlproviders {
50     namespace logging = log4cpp;
51 };
52 #else
53 # error "Supported logging library not available."
54 #endif
55
56 #define XMLPROVIDERS_LOGCAT "XMLProviders"
57
58 #define SHIB_L(s) ::XML::Literals::s
59 #define SHIB_L_QNAME(p,s) ::XML::Literals::p##_##s
60
61 // direct OpenSSL error content to log4cpp
62 void log_openssl();
63
64 // build an OpenSSL object out of a base-64 encoded DER buffer (XML style)
65 X509_CRL* B64_to_CRL(const char* buf);
66 X509* B64_to_X509(const char* buf);
67    
68 class XML
69 {
70 public:
71         // URI constants
72     static const XMLCh SHIB_NS[];
73     static const XMLCh SHIB_SCHEMA_ID[];
74     static const XMLCh SHIBMETA_NS[];
75     static const XMLCh SHIBMETA_SCHEMA_ID[];
76     static const XMLCh CREDS_NS[];
77     static const XMLCh CREDS_SCHEMA_ID[];
78     static const XMLCh TRUST_NS[];
79     static const XMLCh TRUST_SCHEMA_ID[];
80     static const XMLCh SAML2ASSERT_NS[];
81     static const XMLCh SAML2ASSERT_SCHEMA_ID[];
82     static const XMLCh SAML2META_NS[];
83     static const XMLCh SAML2META_SCHEMA_ID[];
84     static const XMLCh XMLENC_NS[];
85     static const XMLCh XMLENC_SCHEMA_ID[];
86         
87     // ds:KeyInfo RetrievalMethods
88     static const XMLCh XMLSIG_RETMETHOD_RAWX509[];  // http://www.w3.org/2000/09/xmldsig#rawX509Certificate
89     static const XMLCh XMLSIG_RETMETHOD_RAWX509CRL[]; // http://www.w3.org/2000/09/xmldsig-more#rawX509CRL
90
91     struct Literals
92     {
93         // old metadata constants
94         static const XMLCh AttributeAuthority[];
95         static const XMLCh Contact[];
96         static const XMLCh Domain[];
97         static const XMLCh Email[];
98         static const XMLCh ErrorURL[];
99         static const XMLCh HandleService[];
100         static const XMLCh InvalidHandle[];
101         static const XMLCh Name[];
102         static const XMLCh OriginSite[];
103         static const XMLCh SiteGroup[];
104
105         static const XMLCh administrative[];
106         static const XMLCh billing[];
107         static const XMLCh other[];
108         static const XMLCh support[];
109         static const XMLCh technical[];
110
111         // credentials constants
112         static const XMLCh CAPath[];
113         static const XMLCh Certificate[];
114         static const XMLCh Class[];
115         static const XMLCh Credentials[];
116         static const XMLCh CustomResolver[];
117         static const XMLCh Key[];
118         static const XMLCh FileResolver[];
119         static const XMLCh format[];
120         static const XMLCh Id[];
121         static const XMLCh password[];
122         static const XMLCh Path[];
123         
124         // trust constants
125         static const XMLCh Exponent[];
126         static const XMLCh KeyAuthority[];
127         static const XMLCh KeyName[];
128         static const XMLCh Modulus[];
129         static const XMLCh RetrievalMethod[];
130         static const XMLCh RSAKeyValue[];
131         static const XMLCh Trust[];
132         static const XMLCh URI[];
133         static const XMLCh VerifyDepth[];
134         static const XMLCh X509CRL[];
135
136         // SAML attribute constants
137         static const XMLCh Accept[];
138         static const XMLCh Alias[];
139         static const XMLCh AnyAttribute[];
140         static const XMLCh AnySite[];
141         static const XMLCh AnyValue[];
142         static const XMLCh AttributeAcceptancePolicy[];
143         static const XMLCh AttributeRule[];
144         static const XMLCh CaseSensitive[];
145         static const XMLCh Factory[];
146         static const XMLCh Header[];
147         static const XMLCh Namespace[];
148         static const XMLCh Scope[];
149         static const XMLCh Scoped[];
150         static const XMLCh SiteRule[];
151         static const XMLCh Type[];
152         static const XMLCh Value[];
153
154         static const XMLCh literal[];
155         static const XMLCh regexp[];
156         static const XMLCh xpath[];
157
158         static const XMLCh Include[];
159         static const XMLCh Exclude[];
160         static const XMLCh url[];
161         static const XMLCh verify[];
162         
163         // new metadata constants
164         static const XMLCh AdditionalMetadataLocation[];
165         static const XMLCh AffiliateMember[];
166         static const XMLCh AffiliationDescriptor[];
167         static const XMLCh affiliationOwnerID[];
168         static const XMLCh Algorithm[];
169         static const XMLCh ArtifactResolutionService[];
170         static const XMLCh AssertionConsumerService[];
171         static const XMLCh AssertionIDRequestService[];
172         static const XMLCh AttributeAuthorityDescriptor[];
173         static const XMLCh AttributeConsumingService[];
174         static const XMLCh AttributeProfile[];
175         static const XMLCh AttributeService[];
176         static const XMLCh AuthnAuthorityDescriptor[];
177         static const XMLCh AuthnQueryService[];
178         static const XMLCh AuthnRequestsSigned[];
179         static const XMLCh AuthzService[];
180         static const XMLCh cacheDuration[];
181         static const XMLCh Company[];
182         static const XMLCh ContactPerson[];
183         static const XMLCh contactType[];
184         static const XMLCh DigestMethod[];
185         static const XMLCh EmailAddress[];
186         static const XMLCh encryption[];
187         static const XMLCh EncryptionMethod[];
188         static const XMLCh EntitiesDescriptor[];
189         static const XMLCh EntityDescriptor[];
190         static const XMLCh entityID[];
191         static const XMLCh errorURL[];
192         static const XMLCh Extensions[];
193         static const XMLCh GivenName[];
194         static const XMLCh IDPSSODescriptor[];
195         static const XMLCh index[];
196         static const XMLCh isDefault[];
197         static const XMLCh isRequired[];
198         static const XMLCh KeyDescriptor[];
199         static const XMLCh KeySize[];
200         static const XMLCh ManageNameIDService[];
201         static const XMLCh _namespace[];
202         static const XMLCh NameFormat[];
203         static const XMLCh NameIDFormat[];
204         static const XMLCh NameIDMappingService[];
205         static const XMLCh OAEParams[];
206         static const XMLCh Organization[];
207         static const XMLCh OrganizationName[];
208         static const XMLCh OrganizationDisplayName[];
209         static const XMLCh OrganizationURL[];
210         static const XMLCh PDPDescriptor[];
211         static const XMLCh protocolSupportEnumeration[];
212         static const XMLCh RequestedAttribute[];
213         static const XMLCh ResponseLocation[];
214         static const XMLCh RoleDescriptor[];
215         static const XMLCh ServiceDescription[];
216         static const XMLCh ServiceName[];
217         static const XMLCh signing[];
218         static const XMLCh SingleLogoutService[];
219         static const XMLCh SingleSignOnService[];
220         static const XMLCh SourceID[];
221         static const XMLCh SPSSODescriptor[];
222         static const XMLCh SurName[];
223         static const XMLCh TelephoneNumber[];
224         static const XMLCh use[];
225         static const XMLCh validUntil[];
226         static const XMLCh WantAuthnRequestsSigned[];
227         static const XMLCh WantAssertionsSigned[];
228
229         // access control constants
230         static const XMLCh AccessControl[];
231         static const XMLCh AND[];
232         static const XMLCh NOT[];
233         static const XMLCh OR[];
234         static const XMLCh require[];
235         static const XMLCh Rule[];
236     };
237 };
238
239 #endif