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