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