Add nil flag to AttributeValue.
[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 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 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 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 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 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 AudienceRestrictionImpl : public virtual AudienceRestriction,
226             public AbstractComplexElement,
227             public AbstractDOMCachingXMLObject,
228             public AbstractXMLObjectMarshaller,
229             public AbstractXMLObjectUnmarshaller
230         {
231         public:
232             virtual ~AudienceRestrictionImpl() {}
233     
234             AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
235                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
236             }
237                 
238             AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
239                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
240                 VectorOf(Audience) v=getAudiences();
241                 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
242                     if (*i) {
243                         v.push_back((*i)->cloneAudience());
244                     }
245                 }
246             }
247             
248             IMPL_XMLOBJECT_CLONE(AudienceRestriction);
249             Condition* cloneCondition() const {
250                 return cloneAudienceRestriction();
251             }
252             IMPL_TYPED_CHILDREN(Audience,m_children.end());
253     
254         protected:
255             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
256                 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
257                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
258             }
259         };
260
261         class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
262             public AbstractSimpleElement,
263             public AbstractDOMCachingXMLObject,
264             public AbstractXMLObjectMarshaller,
265             public AbstractXMLObjectUnmarshaller
266         {
267         public:
268             virtual ~OneTimeUseImpl() {}
269     
270             OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
271                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
272             }
273                 
274             OneTimeUseImpl(const OneTimeUseImpl& src)
275                 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
276             }
277             
278             IMPL_XMLOBJECT_CLONE(OneTimeUse);
279             Condition* cloneCondition() const {
280                 return cloneOneTimeUse();
281             }
282         };
283
284         class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
285             public AbstractComplexElement,
286             public AbstractDOMCachingXMLObject,
287             public AbstractXMLObjectMarshaller,
288             public AbstractXMLObjectUnmarshaller
289         {
290         public:
291             virtual ~ProxyRestrictionImpl() {
292                 XMLString::release(&m_Count);
293             }
294     
295             ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
296                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
297                 m_Count=NULL;
298             }
299                 
300             ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
301                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
302                 setCount(src.m_Count);
303                 VectorOf(Audience) v=getAudiences();
304                 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
305                     if (*i) {
306                         v.push_back((*i)->cloneAudience());
307                     }
308                 }
309             }
310             
311             IMPL_XMLOBJECT_CLONE(ProxyRestriction);
312             Condition* cloneCondition() const {
313                 return cloneProxyRestriction();
314             }
315             IMPL_TYPED_CHILDREN(Audience,m_children.end());
316             IMPL_INTEGER_ATTRIB(Count);
317     
318         protected:
319             void marshallAttributes(DOMElement* domElement) const {
320                 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
321             }
322
323             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
324                 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
325                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
326             }
327
328             void processAttribute(const DOMAttr* attribute) {
329                 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
330                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
331             }
332         };
333
334
335         class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
336             public AbstractComplexElement,
337             public AbstractDOMCachingXMLObject,
338             public AbstractXMLObjectMarshaller,
339             public AbstractXMLObjectUnmarshaller
340         {
341             void init() {
342                 m_NotBefore=m_NotOnOrAfter=NULL;
343             }
344         public:
345             virtual ~ConditionsImpl() {
346                 delete m_NotBefore;
347                 delete m_NotOnOrAfter;
348             }
349     
350             ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
351                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
352                 init();
353             }
354                 
355             ConditionsImpl(const ConditionsImpl& src)
356                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
357                 init();
358                 setNotBefore(src.getNotBefore());
359                 setNotOnOrAfter(src.getNotOnOrAfter());
360
361                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
362                     if (*i) {
363                         AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
364                         if (arc) {
365                             getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
366                             continue;
367                         }
368     
369                         OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
370                         if (dncc) {
371                             getOneTimeUses().push_back(dncc->cloneOneTimeUse());
372                             continue;
373                         }
374     
375                         ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
376                         if (prc) {
377                             getProxyRestrictions().push_back(prc->cloneProxyRestriction());
378                             continue;
379                         }
380
381                         Condition* c=dynamic_cast<Condition*>(*i);
382                         if (c) {
383                             getConditions().push_back(c->cloneCondition());
384                             continue;
385                         }
386                     }
387                 }
388             }
389                         
390             IMPL_XMLOBJECT_CLONE(Conditions);
391             IMPL_DATETIME_ATTRIB(NotBefore,0);
392             IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
393             IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
394             IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
395             IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
396             IMPL_TYPED_CHILDREN(Condition,m_children.end());
397     
398         protected:
399             void marshallAttributes(DOMElement* domElement) const {
400                 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
401                 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
402             }
403     
404             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
405                 PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false);
406                 PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false);
407                 PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false);
408                 PROC_TYPED_CHILDREN(Condition,SAML20_NS,false);
409                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
410             }
411     
412             void processAttribute(const DOMAttr* attribute) {
413                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
414                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
415                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
416             }
417         };
418
419         class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType, public virtual AbstractXMLObject
420         {
421             void init() {
422                 m_NotBefore=m_NotOnOrAfter=NULL;
423                 m_Recipient=m_InResponseTo=m_Address=NULL;
424             }
425
426         protected:
427             SubjectConfirmationDataTypeImpl() {
428                 init();
429             }
430
431         public:
432             virtual ~SubjectConfirmationDataTypeImpl() {
433                 delete m_NotBefore;
434                 delete m_NotOnOrAfter;
435                 XMLString::release(&m_Recipient);
436                 XMLString::release(&m_InResponseTo);
437                 XMLString::release(&m_Address);
438             }
439     
440             SubjectConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
441                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
442                 init();
443             }
444                 
445             SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractXMLObject(src) {
446                 init();
447                 setNotBefore(src.getNotBefore());
448                 setNotOnOrAfter(src.getNotOnOrAfter());
449                 setRecipient(src.getRecipient());
450                 setInResponseTo(src.getInResponseTo());
451                 setAddress(src.getAddress());
452             }
453             
454             IMPL_DATETIME_ATTRIB(NotBefore,0);
455             IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
456             IMPL_STRING_ATTRIB(Recipient);
457             IMPL_STRING_ATTRIB(InResponseTo);
458             IMPL_STRING_ATTRIB(Address);
459             
460         protected:
461             void marshallAttributes(DOMElement* domElement) const {
462                 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
463                 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
464                 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
465                 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
466                 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
467             }
468             
469             void processAttribute(const DOMAttr* attribute) {
470                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
471                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
472                 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
473                 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
474                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
475             }
476         };
477
478         class SAML_DLLLOCAL SubjectConfirmationDataImpl : public SubjectConfirmationData,
479             public SubjectConfirmationDataTypeImpl, public AnyElementImpl
480         {
481         public:
482             virtual ~SubjectConfirmationDataImpl() {}
483     
484             SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
485                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
486             }
487                 
488             SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src)
489                     : SubjectConfirmationDataTypeImpl(src), AnyElementImpl(src) {
490             }
491
492             IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
493             SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
494                 return new SubjectConfirmationDataImpl(*this);
495             }
496
497             void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
498                 if (!qualifiedName.hasNamespaceURI()) {
499                     if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
500                         setNotBefore(value);
501                         return;
502                     }
503                     else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
504                         setNotOnOrAfter(value);
505                         return;
506                     }
507                     else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
508                         setRecipient(value);
509                         return;
510                     }
511                     else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
512                         setInResponseTo(value);
513                         return;
514                     }
515                     else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
516                         setAddress(value);
517                         return;
518                     }
519                 }
520                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
521             }
522
523         protected:
524             void marshallAttributes(DOMElement* domElement) const {
525                 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
526                 AnyElementImpl::marshallAttributes(domElement);
527             }
528
529             void processAttribute(const DOMAttr* attribute) {
530                 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
531                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
532                 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
533                 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
534                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
535                 AnyElementImpl::processAttribute(attribute);
536             }
537         };
538
539         class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
540                 public SubjectConfirmationDataTypeImpl,
541                 public AbstractComplexElement,
542                 public AbstractAttributeExtensibleXMLObject,
543                 public AbstractDOMCachingXMLObject,
544                 public AbstractXMLObjectMarshaller,
545                 public AbstractXMLObjectUnmarshaller
546         {
547         public:
548             virtual ~KeyInfoConfirmationDataTypeImpl() {}
549     
550             KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
551                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
552             }
553                 
554             KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
555                     : AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AbstractComplexElement(src),
556                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
557                 VectorOf(KeyInfo) v=getKeyInfos();
558                 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
559                     v.push_back((*i)->cloneKeyInfo());
560             }
561             
562             IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
563             SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
564                 return new KeyInfoConfirmationDataTypeImpl(*this);
565             }
566
567             IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
568             
569         public:
570             void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
571                 if (!qualifiedName.hasNamespaceURI()) {
572                     if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
573                         setNotBefore(value);
574                         return;
575                     }
576                     else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
577                         setNotOnOrAfter(value);
578                         return;
579                     }
580                     else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
581                         setRecipient(value);
582                         return;
583                     }
584                     else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
585                         setInResponseTo(value);
586                         return;
587                     }
588                     else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
589                         setAddress(value);
590                         return;
591                     }
592                 }
593                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
594             }
595
596         protected:
597             void marshallAttributes(DOMElement* domElement) const {
598                 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
599                 marshallExtensionAttributes(domElement);
600             }
601     
602             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
603                 PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false);
604                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
605             }
606
607             void processAttribute(const DOMAttr* attribute) {
608                 unmarshallExtensionAttribute(attribute);
609             }
610         };
611
612         class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
613             public AbstractComplexElement,
614             public AbstractDOMCachingXMLObject,
615             public AbstractXMLObjectMarshaller,
616             public AbstractXMLObjectUnmarshaller
617         {
618             void init() {
619                 m_Method=NULL;
620                 m_BaseID=NULL;
621                 m_NameID=NULL;
622                 m_EncryptedID=NULL;
623                 m_SubjectConfirmationData=NULL;
624                 m_children.push_back(NULL);
625                 m_children.push_back(NULL);
626                 m_children.push_back(NULL);
627                 m_children.push_back(NULL);
628                 m_pos_BaseID=m_children.begin();
629                 m_pos_NameID=m_pos_BaseID;
630                 ++m_pos_NameID;
631                 m_pos_EncryptedID=m_pos_NameID;
632                 ++m_pos_EncryptedID;
633                 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
634                 ++m_pos_SubjectConfirmationData;
635             }
636         public:
637             virtual ~SubjectConfirmationImpl() {}
638     
639             SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
640                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
641                 init();
642             }
643                 
644             SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
645                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
646                 init();
647                 setMethod(src.getMethod());
648                 if (src.getBaseID())
649                     setBaseID(src.getBaseID()->cloneBaseID());
650                 if (src.getNameID())
651                     setNameID(src.getNameID()->cloneNameID());
652                 if (src.getEncryptedID())
653                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
654                 if (src.getSubjectConfirmationData())
655                     setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
656             }
657             
658             IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
659             IMPL_STRING_ATTRIB(Method);
660             IMPL_TYPED_CHILD(BaseID);
661             IMPL_TYPED_CHILD(NameID);
662             IMPL_TYPED_CHILD(EncryptedID);
663             IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
664     
665         protected:
666             void marshallAttributes(DOMElement* domElement) const {
667                 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
668             }
669
670             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
671                 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
672                 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
673                 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
674                 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS);
675                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
676             }
677
678             void processAttribute(const DOMAttr* attribute) {
679                 PROC_STRING_ATTRIB(Method,METHOD,NULL);
680                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
681             }
682         };
683
684         class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
685             public AbstractComplexElement,
686             public AbstractDOMCachingXMLObject,
687             public AbstractXMLObjectMarshaller,
688             public AbstractXMLObjectUnmarshaller
689         {
690             void init() {
691                 m_BaseID=NULL;
692                 m_NameID=NULL;
693                 m_EncryptedID=NULL;
694                 m_children.push_back(NULL);
695                 m_children.push_back(NULL);
696                 m_children.push_back(NULL);
697                 m_pos_BaseID=m_children.begin();
698                 m_pos_NameID=m_pos_BaseID;
699                 ++m_pos_NameID;
700                 m_pos_EncryptedID=m_pos_NameID;
701                 ++m_pos_EncryptedID;
702             }
703         public:
704             virtual ~SubjectImpl() {}
705     
706             SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
707                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
708                 init();
709             }
710                 
711             SubjectImpl(const SubjectImpl& src)
712                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
713                 init();
714                 if (src.getBaseID())
715                     setBaseID(src.getBaseID()->cloneBaseID());
716                 if (src.getNameID())
717                     setNameID(src.getNameID()->cloneNameID());
718                 if (src.getEncryptedID())
719                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
720                 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
721                 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
722                     if (*i) {
723                         v.push_back((*i)->cloneSubjectConfirmation());
724                     }
725                 }
726             }
727             
728             IMPL_XMLOBJECT_CLONE(Subject);
729             IMPL_TYPED_CHILD(NameID);
730             IMPL_TYPED_CHILD(BaseID);
731             IMPL_TYPED_CHILD(EncryptedID);
732             IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
733     
734         protected:
735             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
736                 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
737                 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
738                 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
739                 PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false);
740                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
741             }
742         };
743
744         class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
745             public AbstractSimpleElement,
746             public AbstractDOMCachingXMLObject,
747             public AbstractXMLObjectMarshaller,
748             public AbstractXMLObjectUnmarshaller
749         {
750             void init() {
751                 m_Address=m_DNSName=NULL;
752             }
753         public:
754             virtual ~SubjectLocalityImpl() {
755                 XMLString::release(&m_Address);
756                 XMLString::release(&m_DNSName);
757             }
758     
759             SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
760                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
761                 init();
762             }
763                 
764             SubjectLocalityImpl(const SubjectLocalityImpl& src)
765                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
766                 init();
767                 setAddress(src.getAddress());
768                 setDNSName(src.getDNSName());
769             }
770             
771             IMPL_XMLOBJECT_CLONE(SubjectLocality);
772             IMPL_STRING_ATTRIB(Address);
773             IMPL_STRING_ATTRIB(DNSName);
774     
775         protected:
776             void marshallAttributes(DOMElement* domElement) const {
777                 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
778                 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
779             }
780     
781             void processAttribute(const DOMAttr* attribute) {
782                 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
783                 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
784                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
785             }
786         };
787
788         //TODO need unit test for this
789         class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
790         {
791         public:
792             virtual ~AuthnContextDeclImpl() {}
793     
794             AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
795                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
796             }
797                 
798             AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
799             }
800             
801             IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
802         };
803
804         class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
805             public AbstractComplexElement,
806             public AbstractDOMCachingXMLObject,
807             public AbstractXMLObjectMarshaller,
808             public AbstractXMLObjectUnmarshaller
809         {
810             void init() {
811                 m_AuthnContextClassRef=NULL;
812                 m_AuthnContextDecl=NULL;
813                 m_AuthnContextDeclRef=NULL;
814                 m_children.push_back(NULL);
815                 m_children.push_back(NULL);
816                 m_children.push_back(NULL);
817                 m_pos_AuthnContextClassRef=m_children.begin();
818                 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
819                 ++m_pos_AuthnContextDecl;
820                 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
821                 ++m_pos_AuthnContextDeclRef;
822             }
823         public:
824             virtual ~AuthnContextImpl() {}
825     
826             AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
827                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
828                 init();
829             }
830                 
831             AuthnContextImpl(const AuthnContextImpl& src)
832                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
833                 init();
834                 if (src.getAuthnContextClassRef())
835                     setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
836                 if (src.getAuthnContextDecl())
837                     setAuthnContextDecl(src.getAuthnContextDecl()->clone());
838                 if (src.getAuthnContextDeclRef())
839                     setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
840                 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
841                 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
842                     if (*i) {
843                         v.push_back((*i)->cloneAuthenticatingAuthority());
844                     }
845                 }
846             }
847             
848             IMPL_XMLOBJECT_CLONE(AuthnContext);
849             IMPL_TYPED_CHILD(AuthnContextClassRef);
850             IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
851             IMPL_TYPED_CHILD(AuthnContextDeclRef);
852             IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
853     
854         protected:
855             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
856                 PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false);
857                 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS);
858                 PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false);
859                 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false);
860                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
861             }
862         };
863
864         class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
865             public AbstractComplexElement,
866             public AbstractDOMCachingXMLObject,
867             public AbstractXMLObjectMarshaller,
868             public AbstractXMLObjectUnmarshaller
869         {
870             void init() {
871                 m_AuthnInstant=NULL;
872                 m_SessionIndex=NULL;
873                 m_SessionNotOnOrAfter=NULL;
874                 m_SubjectLocality=NULL;
875                 m_AuthnContext=NULL;
876                 m_children.push_back(NULL);
877                 m_children.push_back(NULL);
878                 m_pos_SubjectLocality=m_children.begin();
879                 m_pos_AuthnContext=m_pos_SubjectLocality;
880                 ++m_pos_AuthnContext;
881             }
882         public:
883             virtual ~AuthnStatementImpl() {
884                 delete m_AuthnInstant;
885                 XMLString::release(&m_SessionIndex);
886                 delete m_SessionNotOnOrAfter;
887             }
888     
889             AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
890                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
891                 init();
892             }
893                 
894             AuthnStatementImpl(const AuthnStatementImpl& src)
895                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
896                 init();
897                 setAuthnInstant(src.getAuthnInstant());
898                 setSessionIndex(src.getSessionIndex());
899                 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
900                 if (src.getSubjectLocality())
901                     setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
902                 if (src.getAuthnContext())
903                     setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
904             }
905             
906             IMPL_XMLOBJECT_CLONE(AuthnStatement);
907             Statement* cloneStatement() const {
908                 return cloneAuthnStatement();
909             }
910             IMPL_DATETIME_ATTRIB(AuthnInstant,0);
911             IMPL_STRING_ATTRIB(SessionIndex);
912             IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
913             IMPL_TYPED_CHILD(SubjectLocality);
914             IMPL_TYPED_CHILD(AuthnContext);
915     
916         protected:
917             void marshallAttributes(DOMElement* domElement) const {
918                 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
919                 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
920                 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
921             }
922     
923             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
924                 PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false);
925                 PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false);
926                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
927             }
928     
929             void processAttribute(const DOMAttr* attribute) {
930                 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
931                 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
932                 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
933                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
934             }
935         };
936
937         class SAML_DLLLOCAL ActionImpl : public virtual Action,
938             public AbstractSimpleElement,
939             public AbstractDOMCachingXMLObject,
940             public AbstractXMLObjectMarshaller,
941             public AbstractXMLObjectUnmarshaller
942         {
943         public:
944             virtual ~ActionImpl() {
945                 XMLString::release(&m_Namespace);
946             }
947     
948             ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
949                     : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
950             }
951                 
952             ActionImpl(const ActionImpl& src)
953                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
954                 setNamespace(src.getNamespace());
955             }
956             
957             IMPL_XMLOBJECT_CLONE(Action);
958             IMPL_STRING_ATTRIB(Namespace);
959     
960         protected:
961             void marshallAttributes(DOMElement* domElement) const {
962                 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
963             }
964
965             void processAttribute(const DOMAttr* attribute) {
966                 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
967                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
968             }
969         };
970
971         class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
972             public AbstractComplexElement,
973             public AbstractDOMCachingXMLObject,
974             public AbstractXMLObjectMarshaller,
975             public AbstractXMLObjectUnmarshaller
976         {
977         public:
978             virtual ~EvidenceImpl() {}
979     
980             EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
981                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
982             }
983                 
984             EvidenceImpl(const EvidenceImpl& src)
985                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
986                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
987                     if (*i) {
988                         AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
989                         if (ref) {
990                             getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
991                             continue;
992                         }
993     
994                         AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
995                         if (uri) {
996                             getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
997                             continue;
998                         }
999
1000                         Assertion* assertion=dynamic_cast<Assertion*>(*i);
1001                         if (assertion) {
1002                             getAssertions().push_back(assertion->cloneAssertion());
1003                             continue;
1004                         }
1005                         
1006                         EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1007                         if (enc) {
1008                             getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1009                             continue;
1010                         }
1011                     }
1012                 }
1013             }
1014             
1015             IMPL_XMLOBJECT_CLONE(Evidence);
1016             IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1017             IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1018             IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1019             IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1020     
1021         protected:
1022             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1023                 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1024                 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1025                 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1026                 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1027                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1028             }
1029         };
1030
1031         class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1032             public AbstractComplexElement,
1033             public AbstractDOMCachingXMLObject,
1034             public AbstractXMLObjectMarshaller,
1035             public AbstractXMLObjectUnmarshaller
1036         {
1037             void init() {
1038                 m_Resource=NULL;
1039                 m_Decision=NULL;
1040                 m_Evidence=NULL;
1041                 m_children.push_back(NULL);
1042                 m_pos_Evidence=m_children.begin();
1043             }
1044         public:
1045             virtual ~AuthzDecisionStatementImpl() {
1046                 XMLString::release(&m_Resource);
1047                 XMLString::release(&m_Decision);
1048             }
1049     
1050             AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1051                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1052                 init();
1053             }
1054                 
1055             AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1056                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1057                 init();
1058                 setResource(src.getResource());
1059                 setDecision(src.getDecision());
1060                 if (src.getEvidence())
1061                     setEvidence(src.getEvidence()->cloneEvidence());
1062                 VectorOf(Action) v=getActions();
1063                 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1064                     if (*i) {
1065                         v.push_back((*i)->cloneAction());
1066                     }
1067                 }
1068             }
1069             
1070             IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1071             Statement* cloneStatement() const {
1072                 return cloneAuthzDecisionStatement();
1073             }
1074             IMPL_STRING_ATTRIB(Resource);
1075             IMPL_STRING_ATTRIB(Decision);
1076             IMPL_TYPED_CHILD(Evidence);
1077             IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1078     
1079         protected:
1080             void marshallAttributes(DOMElement* domElement) const {
1081                 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1082                 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1083             }
1084     
1085             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1086                 PROC_TYPED_CHILD(Evidence,SAML20_NS,false);
1087                 PROC_TYPED_CHILDREN(Action,SAML20_NS,false);
1088                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1089             }
1090     
1091             void processAttribute(const DOMAttr* attribute) {
1092                 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1093                 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1094                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1095             }
1096         };
1097
1098         class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1099         {
1100                 void init() {
1101                         m_Nil=XML_BOOL_NULL;
1102                 }
1103         public:
1104             virtual ~AttributeValueImpl() {}
1105     
1106             AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1107                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1108                 init();
1109             }
1110                 
1111             AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1112                 init();
1113                 Nil(m_Nil);
1114             }
1115             
1116             IMPL_XMLOBJECT_CLONE(AttributeValue);
1117             IMPL_BOOLEAN_ATTRIB(Nil);
1118
1119             void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
1120                 if (XMLString::equals(qualifiedName.getNamespaceURI(), xmlconstants::XSI_NS)) {
1121                     if (XMLString::equals(qualifiedName.getLocalPart(),NIL_ATTRIB_NAME)) {
1122                         setNil(value);
1123                         return;
1124                     }
1125                 }
1126                 AnyElementImpl::setAttribute(qualifiedName, value, ID);
1127             }
1128
1129         protected:
1130             void marshallAttributes(DOMElement* domElement) const {
1131                 MARSHALL_BOOLEAN_ATTRIB(Nil,NIL,NULL);
1132                 AnyElementImpl::marshallAttributes(domElement);
1133             }
1134
1135             void processAttribute(const DOMAttr* attribute) {
1136                 PROC_BOOLEAN_ATTRIB(Nil,NIL,NULL);
1137                 AnyElementImpl::processAttribute(attribute);
1138             }
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 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 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 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 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 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 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 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(Conditions);
1553 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1554 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1555 IMPL_XMLOBJECTBUILDER(EncryptedID);
1556 IMPL_XMLOBJECTBUILDER(Evidence);
1557 IMPL_XMLOBJECTBUILDER(Issuer);
1558 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1559 IMPL_XMLOBJECTBUILDER(NameID);
1560 IMPL_XMLOBJECTBUILDER(NameIDType);
1561 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1562 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1563 IMPL_XMLOBJECTBUILDER(Subject);
1564 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1565 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1566 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1567
1568 // Unicode literals
1569 const XMLCh Action::LOCAL_NAME[] =                  UNICODE_LITERAL_6(A,c,t,i,o,n);
1570 const XMLCh Action::TYPE_NAME[] =                   UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1571 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] =       UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1572 const XMLCh Advice::LOCAL_NAME[] =                  UNICODE_LITERAL_6(A,d,v,i,c,e);
1573 const XMLCh Advice::TYPE_NAME[] =                   UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1574 const XMLCh Assertion::LOCAL_NAME[] =               UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1575 const XMLCh Assertion::TYPE_NAME[] =                UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1576 const XMLCh Assertion::VER_ATTRIB_NAME[] =          UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1577 const XMLCh Assertion::ID_ATTRIB_NAME[] =           UNICODE_LITERAL_2(I,D);
1578 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1579 const XMLCh AssertionIDRef::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1580 const XMLCh AssertionURIRef::LOCAL_NAME[] =         UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1581 const XMLCh Attribute::LOCAL_NAME[] =               UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1582 const XMLCh Attribute::TYPE_NAME[] =                UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1583 const XMLCh Attribute::NAME_ATTRIB_NAME[] =         UNICODE_LITERAL_4(N,a,m,e);
1584 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] =   UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1585 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1586 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);
1587 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);
1588 const XMLCh AttributeValue::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1589 const XMLCh AttributeValue::NIL_ATTRIB_NAME[] =     UNICODE_LITERAL_3(n,i,l);
1590 const XMLCh Audience::LOCAL_NAME[] =                UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1591 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);
1592 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);
1593 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);
1594 const XMLCh AuthnContext::LOCAL_NAME[] =            UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1595 const XMLCh AuthnContext::TYPE_NAME[] =             UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1596 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);
1597 const XMLCh AuthnContextDecl::LOCAL_NAME[] =        UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1598 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);
1599 const XMLCh AuthnStatement::LOCAL_NAME[] =          UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1600 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);
1601 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] =    UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1602 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] =    UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1603 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);
1604 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);
1605 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);
1606 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] =    UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1607 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] =    UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1608 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1609 const XMLCh AuthzDecisionStatement::DECISION_DENY[] =   UNICODE_LITERAL_4(D,e,n,y);
1610 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] =  UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1611 const XMLCh BaseID::LOCAL_NAME[] =                  UNICODE_LITERAL_6(B,a,s,e,I,D);
1612 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] =   UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1613 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1614 const XMLCh Condition::LOCAL_NAME[] =               UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1615 const XMLCh Conditions::LOCAL_NAME[] =              UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1616 const XMLCh Conditions::TYPE_NAME[] =               UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1617 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] =   UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1618 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1619 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);
1620 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);
1621 const XMLCh EncryptedElementType::LOCAL_NAME[] =    {chNull};
1622 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);
1623 const XMLCh EncryptedID::LOCAL_NAME[] =             UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,D);
1624 const XMLCh Evidence::LOCAL_NAME[] =                UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1625 const XMLCh Evidence::TYPE_NAME[] =                 UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1626 const XMLCh Issuer::LOCAL_NAME[] =                  UNICODE_LITERAL_6(I,s,s,u,e,r);
1627 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);
1628 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);
1629 const XMLCh NameID::LOCAL_NAME[] =                  UNICODE_LITERAL_6(N,a,m,e,I,D);
1630 const XMLCh NameIDType::LOCAL_NAME[] =              {chNull};
1631 const XMLCh NameIDType::TYPE_NAME[] =               UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1632 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] =   UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1633 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1634 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] =      UNICODE_LITERAL_6(F,o,r,m,a,t);
1635 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] =    UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1636 const XMLCh OneTimeUse::LOCAL_NAME[] =              UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1637 const XMLCh OneTimeUse::TYPE_NAME[] =               UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1638 const XMLCh ProxyRestriction::LOCAL_NAME[] =        UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1639 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);
1640 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1641 const XMLCh Statement::LOCAL_NAME[] =               UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1642 const XMLCh Subject::LOCAL_NAME[] =                 UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1643 const XMLCh Subject::TYPE_NAME[] =                  UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1644 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);
1645 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);
1646 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1647 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);
1648 const XMLCh SubjectConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] =      UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1649 const XMLCh SubjectConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] =   UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1650 const XMLCh SubjectConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] =   UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1651 const XMLCh SubjectConfirmationDataType::RECIPIENT_ATTRIB_NAME[] =      UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1652 const XMLCh SubjectConfirmationDataType::ADDRESS_ATTRIB_NAME[] =        UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1653 const XMLCh SubjectLocality::LOCAL_NAME[] =         UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1654 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);
1655 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1656 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1657
1658 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1659 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1660   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1661   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1662   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1663   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1664   chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1665 };
1666
1667 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1668 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1669   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1670   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1671   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1672   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1673   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
1674 };
1675
1676 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1677 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1678   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1679   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1680   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1681   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1682   chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1683   chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1684 };
1685
1686 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1687 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1688   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1689   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1690   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1691   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1692   chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1693   chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1694   chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1695   chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1696 };
1697
1698 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1699 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1700   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1701   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1702   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1703   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1704   chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1705 };
1706
1707 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1708 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1709   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1710   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1711   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1712   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1713   chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1714 };
1715
1716 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1717 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1718   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1719   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1720   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1721   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1722   chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1723 };
1724
1725 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1726 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1727   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1728   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1729   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1730   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1731   chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1732 };
1733
1734 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1735 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1736   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1737   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1738   chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1739 };
1740
1741 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1742 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1743   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1744   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1745   chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1746       chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1747 };
1748
1749 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1750 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1751   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1752   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1753   chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1754       chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1755 };
1756
1757 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1758 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1759   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1760   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1761   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1762   chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1763 };
1764
1765 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1766 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1767   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1768   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1769   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1770   chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1771   chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1772 };
1773
1774 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1775 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1776   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1777   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1778   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1779   chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1780 };
1781
1782 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1783 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1784   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1785   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1786   chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1787   chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1788 };
1789
1790 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1791 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1792   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1793   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1794   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1795   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1796   chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1797 };
1798
1799 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1800 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1801   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1802   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1803   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1804   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1805   chLatin_u, chLatin_r, chLatin_i, chNull
1806 };
1807
1808 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1809 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1810   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1811   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1812   chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1813   chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1814   chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull
1815 };