Xerces 3 revisions.
[shibboleth/cpp-opensaml.git] / saml / saml2 / core / impl / Assertions20Impl.cpp
1 /*
2  *  Copyright 2001-2007 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 /**
18  * Assertions20Impl.cpp
19  *
20  * Implementation classes for SAML 2.0 Assertions schema
21  */
22
23 #include "internal.h"
24 #include "exceptions.h"
25 #include "saml/encryption/EncryptedKeyResolver.h"
26 #include "saml2/core/Assertions.h"
27
28 #include <xmltooling/AbstractComplexElement.h>
29 #include <xmltooling/AbstractSimpleElement.h>
30 #include <xmltooling/impl/AnyElement.h>
31 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
32 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
33 #include <xmltooling/util/XMLHelper.h>
34
35 #include <ctime>
36 #include <xercesc/util/XMLUniDefs.hpp>
37
38 using namespace opensaml::saml2;
39 using namespace xmlencryption;
40 using namespace xmlsignature;
41 using namespace xmltooling;
42 using namespace std;
43 using xmlconstants::XSI_NS;
44 using xmlconstants::XMLSIG_NS;
45 using xmlconstants::XMLENC_NS;
46 using xmlconstants::XML_BOOL_NULL;
47 using samlconstants::SAML20_NS;
48
49
50 #if defined (_MSC_VER)
51     #pragma warning( push )
52     #pragma warning( disable : 4250 4251 )
53 #endif
54
55 namespace opensaml {
56     namespace saml2 {
57
58         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
59         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
60         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
61         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextClassRef);
62         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextDeclRef);
63         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthenticatingAuthority);
64
65         class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType,
66             public AbstractSimpleElement,
67             public AbstractDOMCachingXMLObject,
68             public AbstractXMLObjectMarshaller,
69             public AbstractXMLObjectUnmarshaller
70         {
71             void init() {
72                 m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL;
73             }
74
75         protected:
76             NameIDTypeImpl() {
77                 init();
78             }
79
80         public:
81             virtual ~NameIDTypeImpl() {
82                 XMLString::release(&m_NameQualifier);
83                 XMLString::release(&m_SPNameQualifier);
84                 XMLString::release(&m_Format);
85                 XMLString::release(&m_SPProvidedID);
86             }
87
88             NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
89                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
90                 init();
91             }
92
93             NameIDTypeImpl(const NameIDTypeImpl& src)
94                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
95                 init();
96                 setNameQualifier(src.getNameQualifier());
97                 setSPNameQualifier(src.getSPNameQualifier());
98                 setFormat(src.getFormat());
99                 setSPProvidedID(src.getSPProvidedID());
100             }
101
102             IMPL_XMLOBJECT_CLONE(NameIDType);
103             IMPL_STRING_ATTRIB(NameQualifier);
104             IMPL_STRING_ATTRIB(SPNameQualifier);
105             IMPL_STRING_ATTRIB(Format);
106             IMPL_STRING_ATTRIB(SPProvidedID);
107
108         protected:
109             void marshallAttributes(DOMElement* domElement) const {
110                 MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
111                 MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
112                 MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
113                 MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
114             }
115
116             void processAttribute(const DOMAttr* attribute) {
117                 PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
118                 PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
119                 PROC_STRING_ATTRIB(Format,FORMAT,NULL);
120                 PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
121                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
122             }
123         };
124
125         class SAML_DLLLOCAL NameIDImpl : public virtual NameID, public NameIDTypeImpl
126         {
127         public:
128             virtual ~NameIDImpl() {}
129
130             NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
131                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
132
133             NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
134
135             IMPL_XMLOBJECT_CLONE(NameID);
136             NameIDType* cloneNameIDType() const {
137                 return new NameIDImpl(*this);
138             }
139         };
140
141         class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl
142         {
143         public:
144             virtual ~IssuerImpl() {}
145
146             IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
147                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
148
149             IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
150
151             IMPL_XMLOBJECT_CLONE(Issuer);
152             NameIDType* cloneNameIDType() const {
153                 return new IssuerImpl(*this);
154             }
155         };
156
157         //TODO unit test for this
158         //  - need to test encryption/decryption too, or already done in xmltooling ?
159         class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType,
160             public AbstractComplexElement,
161             public AbstractDOMCachingXMLObject,
162             public AbstractXMLObjectMarshaller,
163             public AbstractXMLObjectUnmarshaller
164         {
165             void init() {
166                 m_EncryptedData=NULL;
167                 m_children.push_back(NULL);
168                 m_pos_EncryptedData=m_children.begin();
169             }
170
171         protected:
172             EncryptedElementTypeImpl() {
173                 init();
174             }
175
176         public:
177             virtual ~EncryptedElementTypeImpl() {}
178
179             EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
180                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
181                 init();
182             }
183
184             EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src)
185                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
186                 init();
187                 if (src.getEncryptedData())
188                     setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
189                 VectorOf(EncryptedKey) v=getEncryptedKeys();
190                 for (vector<EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
191                     if (*i) {
192                         v.push_back((*i)->cloneEncryptedKey());
193                     }
194                 }
195             }
196
197             IMPL_XMLOBJECT_CLONE(EncryptedElementType);
198             IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
199             IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
200
201         protected:
202             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
203                 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
204                 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
205                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
206             }
207         };
208
209         class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
210         {
211         public:
212             virtual ~EncryptedIDImpl() {}
213
214             EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
215                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
216
217             EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
218
219             IMPL_XMLOBJECT_CLONE(EncryptedID);
220             EncryptedElementType* cloneEncryptedElementType() const {
221                 return new EncryptedIDImpl(*this);
222             }
223         };
224
225         class SAML_DLLLOCAL ConditionImpl : public virtual Condition, public AnyElementImpl
226         {
227         public:
228             virtual ~ConditionImpl() {}
229
230             ConditionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
231                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
232             }
233
234             ConditionImpl(const ConditionImpl& src) : AnyElementImpl(src) {}
235
236             IMPL_XMLOBJECT_CLONE(Condition);
237         };
238
239         class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction,
240             public AbstractComplexElement,
241             public AbstractDOMCachingXMLObject,
242             public AbstractXMLObjectMarshaller,
243             public AbstractXMLObjectUnmarshaller
244         {
245         public:
246             virtual ~AudienceRestrictionImpl() {}
247
248             AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
249                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
250             }
251
252             AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
253                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
254                 VectorOf(Audience) v=getAudiences();
255                 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
256                     if (*i) {
257                         v.push_back((*i)->cloneAudience());
258                     }
259                 }
260             }
261
262             IMPL_XMLOBJECT_CLONE(AudienceRestriction);
263             Condition* cloneCondition() const {
264                 return cloneAudienceRestriction();
265             }
266             IMPL_TYPED_CHILDREN(Audience,m_children.end());
267
268         protected:
269             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
270                 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
271                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
272             }
273         };
274
275         class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
276             public AbstractSimpleElement,
277             public AbstractDOMCachingXMLObject,
278             public AbstractXMLObjectMarshaller,
279             public AbstractXMLObjectUnmarshaller
280         {
281         public:
282             virtual ~OneTimeUseImpl() {}
283
284             OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
285                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
286             }
287
288             OneTimeUseImpl(const OneTimeUseImpl& src)
289                 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
290             }
291
292             IMPL_XMLOBJECT_CLONE(OneTimeUse);
293             Condition* cloneCondition() const {
294                 return cloneOneTimeUse();
295             }
296         };
297
298         class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
299             public AbstractComplexElement,
300             public AbstractDOMCachingXMLObject,
301             public AbstractXMLObjectMarshaller,
302             public AbstractXMLObjectUnmarshaller
303         {
304         public:
305             virtual ~ProxyRestrictionImpl() {
306                 XMLString::release(&m_Count);
307             }
308
309             ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
310                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
311                 m_Count=NULL;
312             }
313
314             ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
315                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
316                 setCount(src.m_Count);
317                 VectorOf(Audience) v=getAudiences();
318                 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
319                     if (*i) {
320                         v.push_back((*i)->cloneAudience());
321                     }
322                 }
323             }
324
325             IMPL_XMLOBJECT_CLONE(ProxyRestriction);
326             Condition* cloneCondition() const {
327                 return cloneProxyRestriction();
328             }
329             IMPL_TYPED_CHILDREN(Audience,m_children.end());
330             IMPL_INTEGER_ATTRIB(Count);
331
332         protected:
333             void marshallAttributes(DOMElement* domElement) const {
334                 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
335             }
336
337             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
338                 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
339                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
340             }
341
342             void processAttribute(const DOMAttr* attribute) {
343                 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
344                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
345             }
346         };
347
348
349         class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
350             public AbstractComplexElement,
351             public AbstractDOMCachingXMLObject,
352             public AbstractXMLObjectMarshaller,
353             public AbstractXMLObjectUnmarshaller
354         {
355             void init() {
356                 m_NotBefore=m_NotOnOrAfter=NULL;
357             }
358         public:
359             virtual ~ConditionsImpl() {
360                 delete m_NotBefore;
361                 delete m_NotOnOrAfter;
362             }
363
364             ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
365                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
366                 init();
367             }
368
369             ConditionsImpl(const ConditionsImpl& src)
370                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
371                 init();
372                 setNotBefore(src.getNotBefore());
373                 setNotOnOrAfter(src.getNotOnOrAfter());
374
375                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
376                     if (*i) {
377                         AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
378                         if (arc) {
379                             getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
380                             continue;
381                         }
382
383                         OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
384                         if (dncc) {
385                             getOneTimeUses().push_back(dncc->cloneOneTimeUse());
386                             continue;
387                         }
388
389                         ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
390                         if (prc) {
391                             getProxyRestrictions().push_back(prc->cloneProxyRestriction());
392                             continue;
393                         }
394
395                         Condition* c=dynamic_cast<Condition*>(*i);
396                         if (c) {
397                             getConditions().push_back(c->cloneCondition());
398                             continue;
399                         }
400                     }
401                 }
402             }
403
404             IMPL_XMLOBJECT_CLONE(Conditions);
405             IMPL_DATETIME_ATTRIB(NotBefore,0);
406             IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
407             IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
408             IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
409             IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
410             IMPL_TYPED_CHILDREN(Condition,m_children.end());
411
412         protected:
413             void marshallAttributes(DOMElement* domElement) const {
414                 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
415                 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
416             }
417
418             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
419                 PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false);
420                 PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false);
421                 PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false);
422                 PROC_TYPED_CHILDREN(Condition,SAML20_NS,false);
423                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
424             }
425
426             void processAttribute(const DOMAttr* attribute) {
427                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
428                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
429                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
430             }
431         };
432
433         class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType, public virtual AbstractXMLObject
434         {
435             void init() {
436                 m_NotBefore=m_NotOnOrAfter=NULL;
437                 m_Recipient=m_InResponseTo=m_Address=NULL;
438             }
439
440         protected:
441             SubjectConfirmationDataTypeImpl() {
442                 init();
443             }
444
445         public:
446             virtual ~SubjectConfirmationDataTypeImpl() {
447                 delete m_NotBefore;
448                 delete m_NotOnOrAfter;
449                 XMLString::release(&m_Recipient);
450                 XMLString::release(&m_InResponseTo);
451                 XMLString::release(&m_Address);
452             }
453
454             SubjectConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
455                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
456                 init();
457             }
458
459             SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractXMLObject(src) {
460                 init();
461                 setNotBefore(src.getNotBefore());
462                 setNotOnOrAfter(src.getNotOnOrAfter());
463                 setRecipient(src.getRecipient());
464                 setInResponseTo(src.getInResponseTo());
465                 setAddress(src.getAddress());
466             }
467
468             IMPL_DATETIME_ATTRIB(NotBefore,0);
469             IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
470             IMPL_STRING_ATTRIB(Recipient);
471             IMPL_STRING_ATTRIB(InResponseTo);
472             IMPL_STRING_ATTRIB(Address);
473
474         protected:
475             void marshallAttributes(DOMElement* domElement) const {
476                 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
477                 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
478                 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
479                 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
480                 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
481             }
482
483             void processAttribute(const DOMAttr* attribute) {
484                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
485                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
486                 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
487                 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
488                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
489             }
490         };
491
492         class SAML_DLLLOCAL SubjectConfirmationDataImpl : public SubjectConfirmationData,
493             public SubjectConfirmationDataTypeImpl, public AnyElementImpl
494         {
495         public:
496             virtual ~SubjectConfirmationDataImpl() {}
497
498             SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
499                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
500             }
501
502             SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src)
503                     : SubjectConfirmationDataTypeImpl(src), AnyElementImpl(src) {
504             }
505
506             IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
507             SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
508                 return new SubjectConfirmationDataImpl(*this);
509             }
510
511             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
512                 if (!qualifiedName.hasNamespaceURI()) {
513                     if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
514                         setNotBefore(value);
515                         return;
516                     }
517                     else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
518                         setNotOnOrAfter(value);
519                         return;
520                     }
521                     else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
522                         setRecipient(value);
523                         return;
524                     }
525                     else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
526                         setInResponseTo(value);
527                         return;
528                     }
529                     else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
530                         setAddress(value);
531                         return;
532                     }
533                 }
534                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
535             }
536
537         protected:
538             void marshallAttributes(DOMElement* domElement) const {
539                 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
540                 AnyElementImpl::marshallAttributes(domElement);
541             }
542
543             void processAttribute(const DOMAttr* attribute) {
544                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
545                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
546                 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
547                 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
548                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
549                 AnyElementImpl::processAttribute(attribute);
550             }
551         };
552
553         class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
554                 public SubjectConfirmationDataTypeImpl,
555                 public AbstractComplexElement,
556                 public AbstractAttributeExtensibleXMLObject,
557                 public AbstractDOMCachingXMLObject,
558                 public AbstractXMLObjectMarshaller,
559                 public AbstractXMLObjectUnmarshaller
560         {
561         public:
562             virtual ~KeyInfoConfirmationDataTypeImpl() {}
563
564             KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
565                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
566             }
567
568             KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
569                     : AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AbstractComplexElement(src),
570                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
571                 VectorOf(KeyInfo) v=getKeyInfos();
572                 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
573                     v.push_back((*i)->cloneKeyInfo());
574             }
575
576             IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
577             SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
578                 return new KeyInfoConfirmationDataTypeImpl(*this);
579             }
580
581             IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
582
583         public:
584             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
585                 if (!qualifiedName.hasNamespaceURI()) {
586                     if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
587                         setNotBefore(value);
588                         return;
589                     }
590                     else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
591                         setNotOnOrAfter(value);
592                         return;
593                     }
594                     else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
595                         setRecipient(value);
596                         return;
597                     }
598                     else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
599                         setInResponseTo(value);
600                         return;
601                     }
602                     else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
603                         setAddress(value);
604                         return;
605                     }
606                 }
607                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
608             }
609
610         protected:
611             void marshallAttributes(DOMElement* domElement) const {
612                 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
613                 marshallExtensionAttributes(domElement);
614             }
615
616             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
617                 PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false);
618                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
619             }
620
621             void processAttribute(const DOMAttr* attribute) {
622                 unmarshallExtensionAttribute(attribute);
623             }
624         };
625
626         class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
627             public AbstractComplexElement,
628             public AbstractDOMCachingXMLObject,
629             public AbstractXMLObjectMarshaller,
630             public AbstractXMLObjectUnmarshaller
631         {
632             void init() {
633                 m_Method=NULL;
634                 m_BaseID=NULL;
635                 m_NameID=NULL;
636                 m_EncryptedID=NULL;
637                 m_SubjectConfirmationData=NULL;
638                 m_children.push_back(NULL);
639                 m_children.push_back(NULL);
640                 m_children.push_back(NULL);
641                 m_children.push_back(NULL);
642                 m_pos_BaseID=m_children.begin();
643                 m_pos_NameID=m_pos_BaseID;
644                 ++m_pos_NameID;
645                 m_pos_EncryptedID=m_pos_NameID;
646                 ++m_pos_EncryptedID;
647                 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
648                 ++m_pos_SubjectConfirmationData;
649             }
650         public:
651             virtual ~SubjectConfirmationImpl() {}
652
653             SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
654                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
655                 init();
656             }
657
658             SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
659                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
660                 init();
661                 setMethod(src.getMethod());
662                 if (src.getBaseID())
663                     setBaseID(src.getBaseID()->cloneBaseID());
664                 if (src.getNameID())
665                     setNameID(src.getNameID()->cloneNameID());
666                 if (src.getEncryptedID())
667                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
668                 if (src.getSubjectConfirmationData())
669                     setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
670             }
671
672             IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
673             IMPL_STRING_ATTRIB(Method);
674             IMPL_TYPED_CHILD(BaseID);
675             IMPL_TYPED_CHILD(NameID);
676             IMPL_TYPED_CHILD(EncryptedID);
677             IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
678
679         protected:
680             void marshallAttributes(DOMElement* domElement) const {
681                 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
682             }
683
684             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
685                 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
686                 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
687                 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
688                 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS);
689                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
690             }
691
692             void processAttribute(const DOMAttr* attribute) {
693                 PROC_STRING_ATTRIB(Method,METHOD,NULL);
694                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
695             }
696         };
697
698         class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
699             public AbstractComplexElement,
700             public AbstractDOMCachingXMLObject,
701             public AbstractXMLObjectMarshaller,
702             public AbstractXMLObjectUnmarshaller
703         {
704             void init() {
705                 m_BaseID=NULL;
706                 m_NameID=NULL;
707                 m_EncryptedID=NULL;
708                 m_children.push_back(NULL);
709                 m_children.push_back(NULL);
710                 m_children.push_back(NULL);
711                 m_pos_BaseID=m_children.begin();
712                 m_pos_NameID=m_pos_BaseID;
713                 ++m_pos_NameID;
714                 m_pos_EncryptedID=m_pos_NameID;
715                 ++m_pos_EncryptedID;
716             }
717         public:
718             virtual ~SubjectImpl() {}
719
720             SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
721                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
722                 init();
723             }
724
725             SubjectImpl(const SubjectImpl& src)
726                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
727                 init();
728                 if (src.getBaseID())
729                     setBaseID(src.getBaseID()->cloneBaseID());
730                 if (src.getNameID())
731                     setNameID(src.getNameID()->cloneNameID());
732                 if (src.getEncryptedID())
733                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
734                 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
735                 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
736                     if (*i) {
737                         v.push_back((*i)->cloneSubjectConfirmation());
738                     }
739                 }
740             }
741
742             IMPL_XMLOBJECT_CLONE(Subject);
743             IMPL_TYPED_CHILD(NameID);
744             IMPL_TYPED_CHILD(BaseID);
745             IMPL_TYPED_CHILD(EncryptedID);
746             IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
747
748         protected:
749             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
750                 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
751                 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
752                 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
753                 PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false);
754                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
755             }
756         };
757
758         class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
759             public AbstractSimpleElement,
760             public AbstractDOMCachingXMLObject,
761             public AbstractXMLObjectMarshaller,
762             public AbstractXMLObjectUnmarshaller
763         {
764             void init() {
765                 m_Address=m_DNSName=NULL;
766             }
767         public:
768             virtual ~SubjectLocalityImpl() {
769                 XMLString::release(&m_Address);
770                 XMLString::release(&m_DNSName);
771             }
772
773             SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
774                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
775                 init();
776             }
777
778             SubjectLocalityImpl(const SubjectLocalityImpl& src)
779                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
780                 init();
781                 setAddress(src.getAddress());
782                 setDNSName(src.getDNSName());
783             }
784
785             IMPL_XMLOBJECT_CLONE(SubjectLocality);
786             IMPL_STRING_ATTRIB(Address);
787             IMPL_STRING_ATTRIB(DNSName);
788
789         protected:
790             void marshallAttributes(DOMElement* domElement) const {
791                 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
792                 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
793             }
794
795             void processAttribute(const DOMAttr* attribute) {
796                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
797                 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
798                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
799             }
800         };
801
802         class SAML_DLLLOCAL StatementImpl : public virtual Statement, public AnyElementImpl
803         {
804         public:
805             virtual ~StatementImpl() {}
806
807             StatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
808                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
809             }
810
811             StatementImpl(const StatementImpl& src) : AnyElementImpl(src) {}
812
813             IMPL_XMLOBJECT_CLONE(Statement);
814         };
815
816         //TODO need unit test for this
817         class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
818         {
819         public:
820             virtual ~AuthnContextDeclImpl() {}
821
822             AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
823                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
824             }
825
826             AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
827             }
828
829             IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
830         };
831
832         class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
833             public AbstractComplexElement,
834             public AbstractDOMCachingXMLObject,
835             public AbstractXMLObjectMarshaller,
836             public AbstractXMLObjectUnmarshaller
837         {
838             void init() {
839                 m_AuthnContextClassRef=NULL;
840                 m_AuthnContextDecl=NULL;
841                 m_AuthnContextDeclRef=NULL;
842                 m_children.push_back(NULL);
843                 m_children.push_back(NULL);
844                 m_children.push_back(NULL);
845                 m_pos_AuthnContextClassRef=m_children.begin();
846                 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
847                 ++m_pos_AuthnContextDecl;
848                 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
849                 ++m_pos_AuthnContextDeclRef;
850             }
851         public:
852             virtual ~AuthnContextImpl() {}
853
854             AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
855                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
856                 init();
857             }
858
859             AuthnContextImpl(const AuthnContextImpl& src)
860                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
861                 init();
862                 if (src.getAuthnContextClassRef())
863                     setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
864                 if (src.getAuthnContextDecl())
865                     setAuthnContextDecl(src.getAuthnContextDecl()->clone());
866                 if (src.getAuthnContextDeclRef())
867                     setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
868                 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
869                 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
870                     if (*i) {
871                         v.push_back((*i)->cloneAuthenticatingAuthority());
872                     }
873                 }
874             }
875
876             IMPL_XMLOBJECT_CLONE(AuthnContext);
877             IMPL_TYPED_CHILD(AuthnContextClassRef);
878             IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
879             IMPL_TYPED_CHILD(AuthnContextDeclRef);
880             IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
881
882         protected:
883             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
884                 PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false);
885                 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS);
886                 PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false);
887                 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false);
888                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
889             }
890         };
891
892         class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
893             public AbstractComplexElement,
894             public AbstractDOMCachingXMLObject,
895             public AbstractXMLObjectMarshaller,
896             public AbstractXMLObjectUnmarshaller
897         {
898             void init() {
899                 m_AuthnInstant=NULL;
900                 m_SessionIndex=NULL;
901                 m_SessionNotOnOrAfter=NULL;
902                 m_SubjectLocality=NULL;
903                 m_AuthnContext=NULL;
904                 m_children.push_back(NULL);
905                 m_children.push_back(NULL);
906                 m_pos_SubjectLocality=m_children.begin();
907                 m_pos_AuthnContext=m_pos_SubjectLocality;
908                 ++m_pos_AuthnContext;
909             }
910         public:
911             virtual ~AuthnStatementImpl() {
912                 delete m_AuthnInstant;
913                 XMLString::release(&m_SessionIndex);
914                 delete m_SessionNotOnOrAfter;
915             }
916
917             AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
918                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
919                 init();
920             }
921
922             AuthnStatementImpl(const AuthnStatementImpl& src)
923                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
924                 init();
925                 setAuthnInstant(src.getAuthnInstant());
926                 setSessionIndex(src.getSessionIndex());
927                 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
928                 if (src.getSubjectLocality())
929                     setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
930                 if (src.getAuthnContext())
931                     setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
932             }
933
934             IMPL_XMLOBJECT_CLONE(AuthnStatement);
935             Statement* cloneStatement() const {
936                 return cloneAuthnStatement();
937             }
938             IMPL_DATETIME_ATTRIB(AuthnInstant,0);
939             IMPL_STRING_ATTRIB(SessionIndex);
940             IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
941             IMPL_TYPED_CHILD(SubjectLocality);
942             IMPL_TYPED_CHILD(AuthnContext);
943
944         protected:
945             void marshallAttributes(DOMElement* domElement) const {
946                 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
947                 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
948                 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
949             }
950
951             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
952                 PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false);
953                 PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false);
954                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
955             }
956
957             void processAttribute(const DOMAttr* attribute) {
958                 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
959                 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
960                 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
961                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
962             }
963         };
964
965         class SAML_DLLLOCAL ActionImpl : public virtual Action,
966             public AbstractSimpleElement,
967             public AbstractDOMCachingXMLObject,
968             public AbstractXMLObjectMarshaller,
969             public AbstractXMLObjectUnmarshaller
970         {
971         public:
972             virtual ~ActionImpl() {
973                 XMLString::release(&m_Namespace);
974             }
975
976             ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
977                     : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
978             }
979
980             ActionImpl(const ActionImpl& src)
981                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
982                 setNamespace(src.getNamespace());
983             }
984
985             IMPL_XMLOBJECT_CLONE(Action);
986             IMPL_STRING_ATTRIB(Namespace);
987
988         protected:
989             void marshallAttributes(DOMElement* domElement) const {
990                 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
991             }
992
993             void processAttribute(const DOMAttr* attribute) {
994                 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
995                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
996             }
997         };
998
999         class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
1000             public AbstractComplexElement,
1001             public AbstractDOMCachingXMLObject,
1002             public AbstractXMLObjectMarshaller,
1003             public AbstractXMLObjectUnmarshaller
1004         {
1005         public:
1006             virtual ~EvidenceImpl() {}
1007
1008             EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1009                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1010             }
1011
1012             EvidenceImpl(const EvidenceImpl& src)
1013                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1014                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1015                     if (*i) {
1016                         AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1017                         if (ref) {
1018                             getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1019                             continue;
1020                         }
1021
1022                         AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1023                         if (uri) {
1024                             getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1025                             continue;
1026                         }
1027
1028                         Assertion* assertion=dynamic_cast<Assertion*>(*i);
1029                         if (assertion) {
1030                             getAssertions().push_back(assertion->cloneAssertion());
1031                             continue;
1032                         }
1033
1034                         EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1035                         if (enc) {
1036                             getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1037                             continue;
1038                         }
1039                     }
1040                 }
1041             }
1042
1043             IMPL_XMLOBJECT_CLONE(Evidence);
1044             IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1045             IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1046             IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1047             IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1048
1049         protected:
1050             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1051                 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1052                 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1053                 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1054                 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1055                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1056             }
1057         };
1058
1059         class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1060             public AbstractComplexElement,
1061             public AbstractDOMCachingXMLObject,
1062             public AbstractXMLObjectMarshaller,
1063             public AbstractXMLObjectUnmarshaller
1064         {
1065             void init() {
1066                 m_Resource=NULL;
1067                 m_Decision=NULL;
1068                 m_Evidence=NULL;
1069                 m_children.push_back(NULL);
1070                 m_pos_Evidence=m_children.begin();
1071             }
1072         public:
1073             virtual ~AuthzDecisionStatementImpl() {
1074                 XMLString::release(&m_Resource);
1075                 XMLString::release(&m_Decision);
1076             }
1077
1078             AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1079                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1080                 init();
1081             }
1082
1083             AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1084                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1085                 init();
1086                 setResource(src.getResource());
1087                 setDecision(src.getDecision());
1088                 if (src.getEvidence())
1089                     setEvidence(src.getEvidence()->cloneEvidence());
1090                 VectorOf(Action) v=getActions();
1091                 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1092                     if (*i) {
1093                         v.push_back((*i)->cloneAction());
1094                     }
1095                 }
1096             }
1097
1098             IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1099             Statement* cloneStatement() const {
1100                 return cloneAuthzDecisionStatement();
1101             }
1102             IMPL_STRING_ATTRIB(Resource);
1103             IMPL_STRING_ATTRIB(Decision);
1104             IMPL_TYPED_CHILD(Evidence);
1105             IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1106
1107         protected:
1108             void marshallAttributes(DOMElement* domElement) const {
1109                 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1110                 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1111             }
1112
1113             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1114                 PROC_TYPED_CHILD(Evidence,SAML20_NS,false);
1115                 PROC_TYPED_CHILDREN(Action,SAML20_NS,false);
1116                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1117             }
1118
1119             void processAttribute(const DOMAttr* attribute) {
1120                 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1121                 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1122                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1123             }
1124         };
1125
1126         class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1127         {
1128         public:
1129             virtual ~AttributeValueImpl() {}
1130
1131             AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1132                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1133             }
1134
1135             AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1136             }
1137
1138             IMPL_XMLOBJECT_CLONE(AttributeValue);
1139         };
1140
1141
1142         class SAML_DLLLOCAL AttributeImpl : public virtual Attribute,
1143             public AbstractComplexElement,
1144             public AbstractAttributeExtensibleXMLObject,
1145             public AbstractDOMCachingXMLObject,
1146             public AbstractXMLObjectMarshaller,
1147             public AbstractXMLObjectUnmarshaller
1148         {
1149             void init() {
1150                 m_Name=m_NameFormat=m_FriendlyName=NULL;
1151             }
1152         public:
1153             virtual ~AttributeImpl() {
1154                 XMLString::release(&m_Name);
1155                 XMLString::release(&m_NameFormat);
1156                 XMLString::release(&m_FriendlyName);
1157             }
1158
1159             AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1160                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1161                 init();
1162             }
1163
1164             AttributeImpl(const AttributeImpl& src)
1165                     : AbstractXMLObject(src), AbstractComplexElement(src),
1166                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1167                 init();
1168                 setName(src.getName());
1169                 setNameFormat(src.getNameFormat());
1170                 setFriendlyName(src.getFriendlyName());
1171                 VectorOf(XMLObject) v=getAttributeValues();
1172                 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1173                     if (*i) {
1174                         v.push_back((*i)->clone());
1175                     }
1176                 }
1177             }
1178
1179             IMPL_XMLOBJECT_CLONE(Attribute);
1180             IMPL_STRING_ATTRIB(Name);
1181             IMPL_STRING_ATTRIB(NameFormat);
1182             IMPL_STRING_ATTRIB(FriendlyName);
1183             IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1184
1185             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1186                 if (!qualifiedName.hasNamespaceURI()) {
1187                     if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1188                         setName(value);
1189                         return;
1190                     }
1191                     else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1192                         setNameFormat(value);
1193                         return;
1194                     }
1195                     else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1196                         setFriendlyName(value);
1197                         return;
1198                     }
1199                 }
1200                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1201             }
1202
1203         protected:
1204             void marshallAttributes(DOMElement* domElement) const {
1205                 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1206                 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1207                 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1208                 marshallExtensionAttributes(domElement);
1209             }
1210
1211             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1212                 getAttributeValues().push_back(childXMLObject);
1213             }
1214
1215             void processAttribute(const DOMAttr* attribute) {
1216                 unmarshallExtensionAttribute(attribute);
1217             }
1218         };
1219
1220         //TODO unit test for this
1221         class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl
1222         {
1223         public:
1224             virtual ~EncryptedAttributeImpl() {}
1225
1226             EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1227                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1228
1229             EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1230
1231             IMPL_XMLOBJECT_CLONE(EncryptedAttribute);
1232             EncryptedElementType* cloneEncryptedElementType() const {
1233                 return new EncryptedAttributeImpl(*this);
1234             }
1235         };
1236
1237         class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement,
1238             public AbstractComplexElement,
1239             public AbstractDOMCachingXMLObject,
1240             public AbstractXMLObjectMarshaller,
1241             public AbstractXMLObjectUnmarshaller
1242         {
1243         public:
1244             virtual ~AttributeStatementImpl() {}
1245
1246             AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1247                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1248             }
1249
1250             AttributeStatementImpl(const AttributeStatementImpl& src)
1251                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1252                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1253                     if (*i) {
1254                         Attribute* attribute=dynamic_cast<Attribute*>(*i);
1255                         if (attribute) {
1256                             getAttributes().push_back(attribute->cloneAttribute());
1257                             continue;
1258                         }
1259
1260                         EncryptedAttribute* enc=dynamic_cast<EncryptedAttribute*>(*i);
1261                         if (enc) {
1262                             getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute());
1263                             continue;
1264                         }
1265                     }
1266                 }
1267             }
1268
1269             IMPL_XMLOBJECT_CLONE(AttributeStatement);
1270             Statement* cloneStatement() const {
1271                 return cloneAttributeStatement();
1272             }
1273             IMPL_TYPED_CHILDREN(Attribute, m_children.end());
1274             IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end());
1275
1276         protected:
1277             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1278                 PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false);
1279                 PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false);
1280                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1281             }
1282         };
1283
1284         class SAML_DLLLOCAL AdviceImpl : public virtual Advice,
1285             public AbstractComplexElement,
1286             public AbstractDOMCachingXMLObject,
1287             public AbstractXMLObjectMarshaller,
1288             public AbstractXMLObjectUnmarshaller
1289         {
1290         public:
1291             virtual ~AdviceImpl() {}
1292
1293             AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1294                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1295             }
1296
1297             AdviceImpl(const AdviceImpl& src)
1298                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1299                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1300                     if (*i) {
1301                         AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1302                         if (ref) {
1303                             getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1304                             continue;
1305                         }
1306
1307                         AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1308                         if (uri) {
1309                             getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1310                             continue;
1311                         }
1312
1313                         Assertion* assertion=dynamic_cast<Assertion*>(*i);
1314                         if (assertion) {
1315                             getAssertions().push_back(assertion->cloneAssertion());
1316                             continue;
1317                         }
1318
1319                         EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1320                         if (enc) {
1321                             getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1322                             continue;
1323                         }
1324
1325                         getUnknownXMLObjects().push_back((*i)->clone());
1326                     }
1327                 }
1328             }
1329
1330             IMPL_XMLOBJECT_CLONE(Advice);
1331             IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1332             IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1333             IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1334             IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1335             IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
1336
1337         protected:
1338             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1339                 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1340                 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1341                 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1342                 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1343
1344                 // Unknown child.
1345                 const XMLCh* nsURI=root->getNamespaceURI();
1346                 if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) {
1347                     getUnknownXMLObjects().push_back(childXMLObject);
1348                     return;
1349                 }
1350
1351                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1352             }
1353         };
1354
1355         //TODO unit test for this
1356         class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl
1357         {
1358         public:
1359             virtual ~EncryptedAssertionImpl() {}
1360
1361             EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1362                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1363
1364             EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1365
1366             IMPL_XMLOBJECT_CLONE(EncryptedAssertion);
1367             EncryptedElementType* cloneEncryptedElementType() const {
1368                 return new EncryptedAssertionImpl(*this);
1369             }
1370         };
1371
1372         class SAML_DLLLOCAL AssertionImpl : public virtual Assertion,
1373             public AbstractComplexElement,
1374             public AbstractDOMCachingXMLObject,
1375             public AbstractXMLObjectMarshaller,
1376             public AbstractXMLObjectUnmarshaller
1377         {
1378             void init() {
1379                 m_ID=NULL;
1380                 m_Version=NULL;
1381                 m_IssueInstant=NULL;
1382                 m_Issuer=NULL;
1383                 m_Signature=NULL;
1384                 m_Subject=NULL;
1385                 m_Conditions=NULL;
1386                 m_Advice=NULL;
1387                 m_children.push_back(NULL);
1388                 m_children.push_back(NULL);
1389                 m_children.push_back(NULL);
1390                 m_children.push_back(NULL);
1391                 m_children.push_back(NULL);
1392                 m_pos_Issuer=m_children.begin();
1393                 m_pos_Signature=m_pos_Issuer;
1394                 ++m_pos_Signature;
1395                 m_pos_Subject=m_pos_Signature;
1396                 ++m_pos_Subject;
1397                 m_pos_Conditions=m_pos_Subject;
1398                 ++m_pos_Conditions;
1399                 m_pos_Advice=m_pos_Conditions;
1400                 ++m_pos_Advice;
1401             }
1402         public:
1403             virtual ~AssertionImpl() {
1404                 XMLString::release(&m_ID);
1405                 XMLString::release(&m_Version);
1406                 delete m_IssueInstant;
1407             }
1408
1409             AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1410                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1411                 init();
1412             }
1413
1414             AssertionImpl(const AssertionImpl& src)
1415                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1416                 init();
1417                 setVersion(src.getVersion());
1418                 setID(src.getID());
1419                 setIssueInstant(src.getIssueInstant());
1420                 if (src.getIssuer())
1421                     setIssuer(src.getIssuer()->cloneIssuer());
1422                 if (src.getSignature())
1423                     setSignature(src.getSignature()->cloneSignature());
1424                 if (src.getSubject())
1425                     setSubject(src.getSubject()->cloneSubject());
1426                 if (src.getConditions())
1427                     setConditions(src.getConditions()->cloneConditions());
1428                 if (src.getAdvice())
1429                     setAdvice(src.getAdvice()->cloneAdvice());
1430                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1431                     if (*i) {
1432                         AuthnStatement* authst=dynamic_cast<AuthnStatement*>(*i);
1433                         if (authst) {
1434                             getAuthnStatements().push_back(authst->cloneAuthnStatement());
1435                             continue;
1436                         }
1437
1438                         AttributeStatement* attst=dynamic_cast<AttributeStatement*>(*i);
1439                         if (attst) {
1440                             getAttributeStatements().push_back(attst->cloneAttributeStatement());
1441                             continue;
1442                         }
1443
1444                         AuthzDecisionStatement* authzst=dynamic_cast<AuthzDecisionStatement*>(*i);
1445                         if (authzst) {
1446                             getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement());
1447                             continue;
1448                         }
1449
1450                         Statement* st=dynamic_cast<Statement*>(*i);
1451                         if (st) {
1452                             getStatements().push_back(st->cloneStatement());
1453                             continue;
1454                         }
1455                     }
1456                 }
1457             }
1458
1459             //IMPL_TYPED_CHILD(Signature);
1460             // Need customized setter.
1461         protected:
1462             Signature* m_Signature;
1463             list<XMLObject*>::iterator m_pos_Signature;
1464         public:
1465             Signature* getSignature() const {
1466                 return m_Signature;
1467             }
1468
1469             void setSignature(Signature* sig) {
1470                 prepareForAssignment(m_Signature,sig);
1471                 *m_pos_Signature=m_Signature=sig;
1472                 // Sync content reference back up.
1473                 if (m_Signature)
1474                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
1475             }
1476
1477             IMPL_XMLOBJECT_CLONE(Assertion);
1478             IMPL_STRING_ATTRIB(Version);
1479             IMPL_ID_ATTRIB(ID);
1480             IMPL_DATETIME_ATTRIB(IssueInstant,0);
1481             IMPL_TYPED_CHILD(Issuer);
1482             IMPL_TYPED_CHILD(Subject);
1483             IMPL_TYPED_CHILD(Conditions);
1484             IMPL_TYPED_CHILD(Advice);
1485             IMPL_TYPED_CHILDREN(Statement, m_children.end());
1486             IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end());
1487             IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end());
1488             IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end());
1489
1490         protected:
1491             void marshallAttributes(DOMElement* domElement) const {
1492                 if (!m_Version)
1493                     const_cast<AssertionImpl*>(this)->m_Version=XMLString::transcode("2.0");
1494                 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1495                 if (!m_ID)
1496                     const_cast<AssertionImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1497                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1498                 if (!m_IssueInstant) {
1499                     const_cast<AssertionImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1500                     const_cast<AssertionImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1501                 }
1502                 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1503             }
1504
1505             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1506                 PROC_TYPED_CHILD(Issuer,SAML20_NS,false);
1507                 PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
1508                 PROC_TYPED_CHILD(Subject,SAML20_NS,false);
1509                 PROC_TYPED_CHILD(Conditions,SAML20_NS,false);
1510                 PROC_TYPED_CHILD(Advice,SAML20_NS,false);
1511                 PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false);
1512                 PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false);
1513                 PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false);
1514                 PROC_TYPED_CHILDREN(Statement,SAML20_NS,false);
1515                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1516             }
1517
1518             void processAttribute(const DOMAttr* attribute) {
1519                 PROC_STRING_ATTRIB(Version,VER,NULL);
1520                 PROC_ID_ATTRIB(ID,ID,NULL);
1521                 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1522                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1523             }
1524         };
1525
1526     };
1527 };
1528
1529 #if defined (_MSC_VER)
1530     #pragma warning( pop )
1531 #endif
1532
1533 // Builder Implementations
1534
1535 IMPL_XMLOBJECTBUILDER(Action);
1536 IMPL_XMLOBJECTBUILDER(Advice);
1537 IMPL_XMLOBJECTBUILDER(Assertion);
1538 IMPL_XMLOBJECTBUILDER(AssertionIDRef);
1539 IMPL_XMLOBJECTBUILDER(AssertionURIRef);
1540 IMPL_XMLOBJECTBUILDER(Attribute);
1541 IMPL_XMLOBJECTBUILDER(AttributeStatement);
1542 IMPL_XMLOBJECTBUILDER(AttributeValue);
1543 IMPL_XMLOBJECTBUILDER(Audience);
1544 IMPL_XMLOBJECTBUILDER(AudienceRestriction);
1545 IMPL_XMLOBJECTBUILDER(AuthenticatingAuthority);
1546 IMPL_XMLOBJECTBUILDER(AuthnContext);
1547 IMPL_XMLOBJECTBUILDER(AuthnContextClassRef);
1548 IMPL_XMLOBJECTBUILDER(AuthnContextDecl);
1549 IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef);
1550 IMPL_XMLOBJECTBUILDER(AuthnStatement);
1551 IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement);
1552 IMPL_XMLOBJECTBUILDER(Condition);
1553 IMPL_XMLOBJECTBUILDER(Conditions);
1554 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1555 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1556 IMPL_XMLOBJECTBUILDER(EncryptedID);
1557 IMPL_XMLOBJECTBUILDER(Evidence);
1558 IMPL_XMLOBJECTBUILDER(Issuer);
1559 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1560 IMPL_XMLOBJECTBUILDER(NameID);
1561 IMPL_XMLOBJECTBUILDER(NameIDType);
1562 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1563 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1564 IMPL_XMLOBJECTBUILDER(Statement);
1565 IMPL_XMLOBJECTBUILDER(Subject);
1566 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1567 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1568 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1569
1570 // Unicode literals
1571 const XMLCh Action::LOCAL_NAME[] =                  UNICODE_LITERAL_6(A,c,t,i,o,n);
1572 const XMLCh Action::TYPE_NAME[] =                   UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1573 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] =       UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1574 const XMLCh Advice::LOCAL_NAME[] =                  UNICODE_LITERAL_6(A,d,v,i,c,e);
1575 const XMLCh Advice::TYPE_NAME[] =                   UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1576 const XMLCh Assertion::LOCAL_NAME[] =               UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1577 const XMLCh Assertion::TYPE_NAME[] =                UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1578 const XMLCh Assertion::VER_ATTRIB_NAME[] =          UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1579 const XMLCh Assertion::ID_ATTRIB_NAME[] =           UNICODE_LITERAL_2(I,D);
1580 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1581 const XMLCh AssertionIDRef::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1582 const XMLCh AssertionURIRef::LOCAL_NAME[] =         UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1583 const XMLCh Attribute::LOCAL_NAME[] =               UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1584 const XMLCh Attribute::TYPE_NAME[] =                UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1585 const XMLCh Attribute::NAME_ATTRIB_NAME[] =         UNICODE_LITERAL_4(N,a,m,e);
1586 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] =   UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1587 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1588 const XMLCh AttributeStatement::LOCAL_NAME[] =      UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t);
1589 const XMLCh AttributeStatement::TYPE_NAME[] =       UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t,T,y,p,e);
1590 const XMLCh AttributeValue::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1591 const XMLCh Audience::LOCAL_NAME[] =                UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1592 const XMLCh AudienceRestriction::LOCAL_NAME[] =     UNICODE_LITERAL_19(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n);
1593 const XMLCh AudienceRestriction::TYPE_NAME[] =      UNICODE_LITERAL_23(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1594 const XMLCh AuthenticatingAuthority::LOCAL_NAME[] = UNICODE_LITERAL_23(A,u,t,h,e,n,t,i,c,a,t,i,n,g,A,u,t,h,o,r,i,t,y);
1595 const XMLCh AuthnContext::LOCAL_NAME[] =            UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1596 const XMLCh AuthnContext::TYPE_NAME[] =             UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1597 const XMLCh AuthnContextClassRef::LOCAL_NAME[] =    UNICODE_LITERAL_20(A,u,t,h,n,C,o,n,t,e,x,t,C,l,a,s,s,R,e,f);
1598 const XMLCh AuthnContextDecl::LOCAL_NAME[] =        UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1599 const XMLCh AuthnContextDeclRef::LOCAL_NAME[] =     UNICODE_LITERAL_19(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l,R,e,f);
1600 const XMLCh AuthnStatement::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1601 const XMLCh AuthnStatement::TYPE_NAME[] =           UNICODE_LITERAL_18(A,u,t,h,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1602 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] =    UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1603 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] =    UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1604 const XMLCh AuthnStatement::SESSIONNOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_19(S,e,s,s,i,o,n,N,o,t,O,n,O,r,A,f,t,e,r);
1605 const XMLCh AuthzDecisionStatement::LOCAL_NAME[] =  UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t);
1606 const XMLCh AuthzDecisionStatement::TYPE_NAME[] =   UNICODE_LITERAL_26(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1607 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] =    UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1608 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] =    UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1609 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1610 const XMLCh AuthzDecisionStatement::DECISION_DENY[] =   UNICODE_LITERAL_4(D,e,n,y);
1611 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] =  UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1612 const XMLCh BaseID::LOCAL_NAME[] =                  UNICODE_LITERAL_6(B,a,s,e,I,D);
1613 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] =   UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1614 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1615 const XMLCh Condition::LOCAL_NAME[] =               UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1616 const XMLCh Conditions::LOCAL_NAME[] =              UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1617 const XMLCh Conditions::TYPE_NAME[] =               UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1618 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] =   UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1619 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1620 const XMLCh EncryptedAssertion::LOCAL_NAME[] =      UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,s,s,e,r,t,i,o,n);
1621 const XMLCh EncryptedAttribute::LOCAL_NAME[] =      UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,t,t,r,i,b,u,t,e);
1622 const XMLCh EncryptedElementType::LOCAL_NAME[] =    {chNull};
1623 const XMLCh EncryptedElementType::TYPE_NAME[] =     UNICODE_LITERAL_20(E,n,c,r,y,p,t,e,d,E,l,e,m,e,n,t,T,y,p,e);
1624 const XMLCh EncryptedID::LOCAL_NAME[] =             UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,D);
1625 const XMLCh Evidence::LOCAL_NAME[] =                UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1626 const XMLCh Evidence::TYPE_NAME[] =                 UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1627 const XMLCh Issuer::LOCAL_NAME[] =                  UNICODE_LITERAL_6(I,s,s,u,e,r);
1628 const XMLCh KeyInfoConfirmationDataType::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1629 const XMLCh KeyInfoConfirmationDataType::TYPE_NAME[] = UNICODE_LITERAL_27(K,e,y,I,n,f,o,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a,T,y,p,e);
1630 const XMLCh NameID::LOCAL_NAME[] =                  UNICODE_LITERAL_6(N,a,m,e,I,D);
1631 const XMLCh NameIDType::LOCAL_NAME[] =              {chNull};
1632 const XMLCh NameIDType::TYPE_NAME[] =               UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1633 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] =   UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1634 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1635 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] =      UNICODE_LITERAL_6(F,o,r,m,a,t);
1636 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] =    UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1637 const XMLCh OneTimeUse::LOCAL_NAME[] =              UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1638 const XMLCh OneTimeUse::TYPE_NAME[] =               UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1639 const XMLCh ProxyRestriction::LOCAL_NAME[] =        UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1640 const XMLCh ProxyRestriction::TYPE_NAME[] =         UNICODE_LITERAL_20(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1641 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1642 const XMLCh Statement::LOCAL_NAME[] =               UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1643 const XMLCh Subject::LOCAL_NAME[] =                 UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1644 const XMLCh Subject::TYPE_NAME[] =                  UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1645 const XMLCh SubjectConfirmation::LOCAL_NAME[] =     UNICODE_LITERAL_19(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n);
1646 const XMLCh SubjectConfirmation::TYPE_NAME[] =      UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,T,y,p,e);
1647 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1648 const XMLCh SubjectConfirmationData::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1649 const XMLCh SubjectConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] =      UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1650 const XMLCh SubjectConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] =   UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1651 const XMLCh SubjectConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] =   UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1652 const XMLCh SubjectConfirmationDataType::RECIPIENT_ATTRIB_NAME[] =      UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1653 const XMLCh SubjectConfirmationDataType::ADDRESS_ATTRIB_NAME[] =        UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1654 const XMLCh SubjectLocality::LOCAL_NAME[] =         UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1655 const XMLCh SubjectLocality::TYPE_NAME[] =          UNICODE_LITERAL_19(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y,T,y,p,e);
1656 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1657 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1658
1659 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1660 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1661   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1662   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1663   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1664   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1665   chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull
1666 };
1667
1668 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1669 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1670   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1671   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1672   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1673   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1674   chLatin_e, chLatin_m, chLatin_a, chLatin_i, chLatin_l, chLatin_A, chLatin_d, chLatin_d, chLatin_r, chLatin_e, chLatin_s, chLatin_s, chNull
1675 };
1676
1677 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1678 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1679   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1680   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1681   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1682   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1683   chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1684   chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1685 };
1686
1687 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1688 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1689   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1690   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1691   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1692   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1693   chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1694   chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1695   chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1696   chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1697 };
1698
1699 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1700 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1701   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1702   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1703   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1704   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1705   chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1706 };
1707
1708 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1709 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1710   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1711   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1712   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1713   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1714   chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1715 };
1716
1717 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1718 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1719   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1720   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1721   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1722   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1723   chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1724 };
1725
1726 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1727 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1728   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1729   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1730   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1731   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1732   chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1733 };
1734
1735 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1736 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1737   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1738   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1739   chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1740 };
1741
1742 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1743 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1744   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1745   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1746   chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1747       chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1748 };
1749
1750 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1751 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1752   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1753   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1754   chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1755       chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1756 };
1757
1758 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1759 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1760   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1761   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1762   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1763   chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1764 };
1765
1766 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1767 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1768   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1769   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1770   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1771   chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1772   chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1773 };
1774
1775 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1776 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1777   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1778   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1779   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1780   chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1781 };
1782
1783 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1784 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1785   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1786   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1787   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1788   chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1789 };
1790
1791 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1792 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1793   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1794   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1795   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1796   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1797   chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull
1798 };
1799
1800 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1801 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1802   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1803   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1804   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1805   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1806   chLatin_u, chLatin_r, chLatin_i, chNull
1807 };
1808
1809 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1810 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1811   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1812   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1813   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1814   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1815   chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull
1816 };