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