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