2 * Copyright 2001-2006 Internet2
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * Assertions20Impl.cpp
20 * Implementation classes for SAML 2.0 Assertions schema
24 #include "exceptions.h"
25 #include "saml/encryption/EncryptedKeyResolver.h"
26 #include "saml2/core/Assertions.h"
28 #include <xmltooling/AbstractComplexElement.h>
29 #include <xmltooling/AbstractElementProxy.h>
30 #include <xmltooling/AbstractSimpleElement.h>
31 #include <xmltooling/encryption/Decrypter.h>
32 #include <xmltooling/impl/AnyElement.h>
33 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
34 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
35 #include <xmltooling/util/XMLHelper.h>
38 #include <xercesc/util/XMLUniDefs.hpp>
40 using namespace opensaml::saml2;
41 using namespace opensaml;
42 using namespace xmlencryption;
43 using namespace xmlsignature;
44 using namespace xmltooling;
46 using xmlconstants::XMLSIG_NS;
47 using xmlconstants::XMLENC_NS;
48 using samlconstants::SAML20_NS;
50 #if defined (_MSC_VER)
51 #pragma warning( push )
52 #pragma warning( disable : 4250 4251 )
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
61 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextClassRef);
62 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextDeclRef);
63 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthenticatingAuthority);
65 class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType,
66 public AbstractSimpleElement,
67 public AbstractDOMCachingXMLObject,
68 public AbstractXMLObjectMarshaller,
69 public AbstractXMLObjectUnmarshaller
72 m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL;
81 virtual ~NameIDTypeImpl() {
82 XMLString::release(&m_NameQualifier);
83 XMLString::release(&m_SPNameQualifier);
84 XMLString::release(&m_Format);
85 XMLString::release(&m_SPProvidedID);
88 NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
89 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
93 NameIDTypeImpl(const NameIDTypeImpl& src)
94 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
96 setNameQualifier(src.getNameQualifier());
97 setSPNameQualifier(src.getSPNameQualifier());
98 setFormat(src.getFormat());
99 setSPProvidedID(src.getSPProvidedID());
102 IMPL_XMLOBJECT_CLONE(NameIDType);
103 IMPL_STRING_ATTRIB(NameQualifier);
104 IMPL_STRING_ATTRIB(SPNameQualifier);
105 IMPL_STRING_ATTRIB(Format);
106 IMPL_STRING_ATTRIB(SPProvidedID);
109 void marshallAttributes(DOMElement* domElement) const {
110 MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
111 MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
112 MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
113 MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
116 void processAttribute(const DOMAttr* attribute) {
117 PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
118 PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
119 PROC_STRING_ATTRIB(Format,FORMAT,NULL);
120 PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
121 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
125 class SAML_DLLLOCAL NameIDImpl : public virtual NameID, public NameIDTypeImpl
128 virtual ~NameIDImpl() {}
130 NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
131 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
133 NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
135 IMPL_XMLOBJECT_CLONE(NameID);
136 NameIDType* cloneNameIDType() const {
137 return new NameIDImpl(*this);
141 class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl
144 virtual ~IssuerImpl() {}
146 IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
147 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
149 IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
151 IMPL_XMLOBJECT_CLONE(Issuer);
152 NameIDType* cloneNameIDType() const {
153 return new IssuerImpl(*this);
157 //TODO unit test for this
158 // - need to test encryption/decryption too, or already done in xmltooling ?
159 class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType,
160 public AbstractComplexElement,
161 public AbstractDOMCachingXMLObject,
162 public AbstractXMLObjectMarshaller,
163 public AbstractXMLObjectUnmarshaller
166 m_EncryptedData=NULL;
167 m_children.push_back(NULL);
168 m_pos_EncryptedData=m_children.begin();
172 EncryptedElementTypeImpl() {
177 virtual ~EncryptedElementTypeImpl() {}
179 EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
180 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
184 EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src)
185 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
187 if (src.getEncryptedData())
188 setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
189 VectorOf(EncryptedKey) v=getEncryptedKeys();
190 for (vector<EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
192 v.push_back((*i)->cloneEncryptedKey());
197 XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
199 if (!m_EncryptedData)
200 throw DecryptionException("No encrypted data present.");
201 Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
202 DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
203 if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
204 DOMNode* plaintext=frag->getFirstChild();
205 if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
206 auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
207 ret->releaseThisAndChildrenDOM();
208 return ret.release();
212 throw DecryptionException("Decryption did not result in a single element.");
215 IMPL_XMLOBJECT_CLONE(EncryptedElementType);
216 IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
217 IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
220 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
221 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
222 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
223 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
227 //TODO unit test for this
228 class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
231 virtual ~EncryptedIDImpl() {}
233 EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
234 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
236 EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
238 IMPL_XMLOBJECT_CLONE(EncryptedID);
239 EncryptedElementType* cloneEncryptedElementType() const {
240 return new EncryptedIDImpl(*this);
244 class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction,
245 public AbstractComplexElement,
246 public AbstractDOMCachingXMLObject,
247 public AbstractXMLObjectMarshaller,
248 public AbstractXMLObjectUnmarshaller
251 virtual ~AudienceRestrictionImpl() {}
253 AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
254 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
257 AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
258 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
259 VectorOf(Audience) v=getAudiences();
260 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
262 v.push_back((*i)->cloneAudience());
267 IMPL_XMLOBJECT_CLONE(AudienceRestriction);
268 Condition* cloneCondition() const {
269 return cloneAudienceRestriction();
271 IMPL_TYPED_CHILDREN(Audience,m_children.end());
274 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
275 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
276 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
280 class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
281 public AbstractSimpleElement,
282 public AbstractDOMCachingXMLObject,
283 public AbstractXMLObjectMarshaller,
284 public AbstractXMLObjectUnmarshaller
287 virtual ~OneTimeUseImpl() {}
289 OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
290 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
293 OneTimeUseImpl(const OneTimeUseImpl& src)
294 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
297 IMPL_XMLOBJECT_CLONE(OneTimeUse);
298 Condition* cloneCondition() const {
299 return cloneOneTimeUse();
303 class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
304 public AbstractComplexElement,
305 public AbstractDOMCachingXMLObject,
306 public AbstractXMLObjectMarshaller,
307 public AbstractXMLObjectUnmarshaller
310 virtual ~ProxyRestrictionImpl() {
311 XMLString::release(&m_Count);
314 ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
315 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
319 ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
320 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
321 setCount(src.m_Count);
322 VectorOf(Audience) v=getAudiences();
323 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
325 v.push_back((*i)->cloneAudience());
330 IMPL_XMLOBJECT_CLONE(ProxyRestriction);
331 Condition* cloneCondition() const {
332 return cloneProxyRestriction();
334 IMPL_TYPED_CHILDREN(Audience,m_children.end());
335 IMPL_INTEGER_ATTRIB(Count);
338 void marshallAttributes(DOMElement* domElement) const {
339 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
342 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
343 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
344 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
347 void processAttribute(const DOMAttr* attribute) {
348 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
349 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
354 class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
355 public AbstractComplexElement,
356 public AbstractDOMCachingXMLObject,
357 public AbstractXMLObjectMarshaller,
358 public AbstractXMLObjectUnmarshaller
361 m_NotBefore=m_NotOnOrAfter=NULL;
364 virtual ~ConditionsImpl() {
366 delete m_NotOnOrAfter;
369 ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
370 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
374 ConditionsImpl(const ConditionsImpl& src)
375 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
377 setNotBefore(src.getNotBefore());
378 setNotOnOrAfter(src.getNotOnOrAfter());
380 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
382 AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
384 getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
388 OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
390 getOneTimeUses().push_back(dncc->cloneOneTimeUse());
394 ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
396 getProxyRestrictions().push_back(prc->cloneProxyRestriction());
400 Condition* c=dynamic_cast<Condition*>(*i);
402 getConditions().push_back(c->cloneCondition());
409 IMPL_XMLOBJECT_CLONE(Conditions);
410 IMPL_DATETIME_ATTRIB(NotBefore,0);
411 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
412 IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
413 IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
414 IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
415 IMPL_TYPED_CHILDREN(Condition,m_children.end());
418 void marshallAttributes(DOMElement* domElement) const {
419 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
420 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
423 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
424 PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false);
425 PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false);
426 PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false);
427 PROC_TYPED_CHILDREN(Condition,SAML20_NS,false);
428 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
431 void processAttribute(const DOMAttr* attribute) {
432 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
433 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
434 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
438 class SAML_DLLLOCAL SubjectConfirmationDataImpl : public virtual SubjectConfirmationData, public AnyElementImpl
441 m_NotBefore=m_NotOnOrAfter=NULL;
442 m_Recipient=m_InResponseTo=m_Address=NULL;
445 virtual ~SubjectConfirmationDataImpl() {
447 delete m_NotOnOrAfter;
448 XMLString::release(&m_Recipient);
449 XMLString::release(&m_InResponseTo);
450 XMLString::release(&m_Address);
453 SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
454 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
458 SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src) : AnyElementImpl(src) {
460 setNotBefore(src.getNotBefore());
461 setNotOnOrAfter(src.getNotOnOrAfter());
462 setRecipient(src.getRecipient());
463 setInResponseTo(src.getInResponseTo());
464 setAddress(src.getAddress());
467 IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
468 IMPL_DATETIME_ATTRIB(NotBefore,0);
469 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
470 IMPL_STRING_ATTRIB(Recipient);
471 IMPL_STRING_ATTRIB(InResponseTo);
472 IMPL_STRING_ATTRIB(Address);
475 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
476 if (!qualifiedName.hasNamespaceURI()) {
477 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
481 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
482 setNotOnOrAfter(value);
485 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
489 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
490 setInResponseTo(value);
493 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
498 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
502 void marshallAttributes(DOMElement* domElement) const {
503 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
504 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
505 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
506 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
507 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
508 AnyElementImpl::marshallAttributes(domElement);
511 // The processAttributes hook is handled by AnyElementImpl
514 class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
515 public AbstractComplexElement,
516 public AbstractAttributeExtensibleXMLObject,
517 public AbstractDOMCachingXMLObject,
518 public AbstractXMLObjectMarshaller,
519 public AbstractXMLObjectUnmarshaller
522 m_NotBefore=m_NotOnOrAfter=NULL;
523 m_Recipient=m_InResponseTo=m_Address=NULL;
526 virtual ~KeyInfoConfirmationDataTypeImpl() {
528 delete m_NotOnOrAfter;
529 XMLString::release(&m_Recipient);
530 XMLString::release(&m_InResponseTo);
531 XMLString::release(&m_Address);
534 KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
535 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
539 KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
540 : AbstractXMLObject(src), AbstractComplexElement(src),
541 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
543 setNotBefore(src.getNotBefore());
544 setNotOnOrAfter(src.getNotOnOrAfter());
545 setRecipient(src.getRecipient());
546 setInResponseTo(src.getInResponseTo());
547 setAddress(src.getAddress());
548 VectorOf(KeyInfo) v=getKeyInfos();
549 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); i++) {
551 v.push_back((*i)->cloneKeyInfo());
556 IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
557 IMPL_DATETIME_ATTRIB(NotBefore,0);
558 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
559 IMPL_STRING_ATTRIB(Recipient);
560 IMPL_STRING_ATTRIB(InResponseTo);
561 IMPL_STRING_ATTRIB(Address);
562 IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
565 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
566 if (!qualifiedName.hasNamespaceURI()) {
567 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
571 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
572 setNotOnOrAfter(value);
575 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
579 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
580 setInResponseTo(value);
583 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
588 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
592 void marshallAttributes(DOMElement* domElement) const {
593 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
594 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
595 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
596 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
597 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
598 marshallExtensionAttributes(domElement);
601 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
602 PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false);
603 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
606 void processAttribute(const DOMAttr* attribute) {
607 unmarshallExtensionAttribute(attribute);
611 class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
612 public AbstractComplexElement,
613 public AbstractDOMCachingXMLObject,
614 public AbstractXMLObjectMarshaller,
615 public AbstractXMLObjectUnmarshaller
622 m_SubjectConfirmationData=NULL;
623 m_KeyInfoConfirmationDataType=NULL;
624 m_children.push_back(NULL);
625 m_children.push_back(NULL);
626 m_children.push_back(NULL);
627 m_children.push_back(NULL);
628 m_pos_BaseID=m_children.begin();
629 m_pos_NameID=m_pos_BaseID;
631 m_pos_EncryptedID=m_pos_NameID;
633 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
634 ++m_pos_SubjectConfirmationData;
635 m_pos_KeyInfoConfirmationDataType=m_pos_SubjectConfirmationData;
636 ++m_pos_KeyInfoConfirmationDataType;
639 virtual ~SubjectConfirmationImpl() {}
641 SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
642 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
646 SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
647 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
649 setMethod(src.getMethod());
651 setBaseID(src.getBaseID()->cloneBaseID());
653 setNameID(src.getNameID()->cloneNameID());
654 if (src.getEncryptedID())
655 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
656 if (src.getSubjectConfirmationData())
657 setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
658 if (src.getKeyInfoConfirmationDataType())
659 setKeyInfoConfirmationDataType(src.getKeyInfoConfirmationDataType()->cloneKeyInfoConfirmationDataType());
662 IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
663 IMPL_STRING_ATTRIB(Method);
664 IMPL_TYPED_CHILD(BaseID);
665 IMPL_TYPED_CHILD(NameID);
666 IMPL_TYPED_CHILD(EncryptedID);
667 IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
668 IMPL_TYPED_CHILD(KeyInfoConfirmationDataType);
671 void marshallAttributes(DOMElement* domElement) const {
672 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
675 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
676 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
677 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
678 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
679 PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAML20_NS,false);
680 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS);
681 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
684 void processAttribute(const DOMAttr* attribute) {
685 PROC_STRING_ATTRIB(Method,METHOD,NULL);
686 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
690 class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
691 public AbstractComplexElement,
692 public AbstractDOMCachingXMLObject,
693 public AbstractXMLObjectMarshaller,
694 public AbstractXMLObjectUnmarshaller
700 m_children.push_back(NULL);
701 m_children.push_back(NULL);
702 m_children.push_back(NULL);
703 m_pos_BaseID=m_children.begin();
704 m_pos_NameID=m_pos_BaseID;
706 m_pos_EncryptedID=m_pos_NameID;
710 virtual ~SubjectImpl() {}
712 SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
713 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
717 SubjectImpl(const SubjectImpl& src)
718 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
721 setBaseID(src.getBaseID()->cloneBaseID());
723 setNameID(src.getNameID()->cloneNameID());
724 if (src.getEncryptedID())
725 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
726 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
727 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
729 v.push_back((*i)->cloneSubjectConfirmation());
734 IMPL_XMLOBJECT_CLONE(Subject);
735 IMPL_TYPED_CHILD(NameID);
736 IMPL_TYPED_CHILD(BaseID);
737 IMPL_TYPED_CHILD(EncryptedID);
738 IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
741 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
742 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
743 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
744 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
745 PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false);
746 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
750 class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
751 public AbstractSimpleElement,
752 public AbstractDOMCachingXMLObject,
753 public AbstractXMLObjectMarshaller,
754 public AbstractXMLObjectUnmarshaller
757 m_Address=m_DNSName=NULL;
760 virtual ~SubjectLocalityImpl() {
761 XMLString::release(&m_Address);
762 XMLString::release(&m_DNSName);
765 SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
766 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
770 SubjectLocalityImpl(const SubjectLocalityImpl& src)
771 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
773 setAddress(src.getAddress());
774 setDNSName(src.getDNSName());
777 IMPL_XMLOBJECT_CLONE(SubjectLocality);
778 IMPL_STRING_ATTRIB(Address);
779 IMPL_STRING_ATTRIB(DNSName);
782 void marshallAttributes(DOMElement* domElement) const {
783 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
784 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
787 void processAttribute(const DOMAttr* attribute) {
788 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
789 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
790 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
794 //TODO need unit test for this
795 class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
798 virtual ~AuthnContextDeclImpl() {}
800 AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
801 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
804 AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
807 IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
810 class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
811 public AbstractComplexElement,
812 public AbstractDOMCachingXMLObject,
813 public AbstractXMLObjectMarshaller,
814 public AbstractXMLObjectUnmarshaller
817 m_AuthnContextClassRef=NULL;
818 m_AuthnContextDecl=NULL;
819 m_AuthnContextDeclRef=NULL;
820 m_children.push_back(NULL);
821 m_children.push_back(NULL);
822 m_children.push_back(NULL);
823 m_pos_AuthnContextClassRef=m_children.begin();
824 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
825 ++m_pos_AuthnContextDecl;
826 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
827 ++m_pos_AuthnContextDeclRef;
830 virtual ~AuthnContextImpl() {}
832 AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
833 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
837 AuthnContextImpl(const AuthnContextImpl& src)
838 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
840 if (src.getAuthnContextClassRef())
841 setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
842 if (src.getAuthnContextDecl())
843 setAuthnContextDecl(src.getAuthnContextDecl()->clone());
844 if (src.getAuthnContextDeclRef())
845 setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
846 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
847 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
849 v.push_back((*i)->cloneAuthenticatingAuthority());
854 IMPL_XMLOBJECT_CLONE(AuthnContext);
855 IMPL_TYPED_CHILD(AuthnContextClassRef);
856 IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
857 IMPL_TYPED_CHILD(AuthnContextDeclRef);
858 IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
861 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
862 PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false);
863 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS);
864 PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false);
865 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false);
866 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
870 class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
871 public AbstractComplexElement,
872 public AbstractDOMCachingXMLObject,
873 public AbstractXMLObjectMarshaller,
874 public AbstractXMLObjectUnmarshaller
879 m_SessionNotOnOrAfter=NULL;
880 m_SubjectLocality=NULL;
882 m_children.push_back(NULL);
883 m_children.push_back(NULL);
884 m_pos_SubjectLocality=m_children.begin();
885 m_pos_AuthnContext=m_pos_SubjectLocality;
886 ++m_pos_AuthnContext;
889 virtual ~AuthnStatementImpl() {
890 delete m_AuthnInstant;
891 XMLString::release(&m_SessionIndex);
892 delete m_SessionNotOnOrAfter;
895 AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
896 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
900 AuthnStatementImpl(const AuthnStatementImpl& src)
901 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
903 setAuthnInstant(src.getAuthnInstant());
904 setSessionIndex(src.getSessionIndex());
905 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
906 if (src.getSubjectLocality())
907 setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
908 if (src.getAuthnContext())
909 setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
912 IMPL_XMLOBJECT_CLONE(AuthnStatement);
913 Statement* cloneStatement() const {
914 return cloneAuthnStatement();
916 IMPL_DATETIME_ATTRIB(AuthnInstant,0);
917 IMPL_STRING_ATTRIB(SessionIndex);
918 IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
919 IMPL_TYPED_CHILD(SubjectLocality);
920 IMPL_TYPED_CHILD(AuthnContext);
923 void marshallAttributes(DOMElement* domElement) const {
924 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
925 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
926 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
929 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
930 PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false);
931 PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false);
932 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
935 void processAttribute(const DOMAttr* attribute) {
936 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
937 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
938 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
939 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
943 class SAML_DLLLOCAL ActionImpl : public virtual Action,
944 public AbstractSimpleElement,
945 public AbstractDOMCachingXMLObject,
946 public AbstractXMLObjectMarshaller,
947 public AbstractXMLObjectUnmarshaller
950 virtual ~ActionImpl() {
951 XMLString::release(&m_Namespace);
954 ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
955 : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
958 ActionImpl(const ActionImpl& src)
959 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
960 setNamespace(src.getNamespace());
963 IMPL_XMLOBJECT_CLONE(Action);
964 IMPL_STRING_ATTRIB(Namespace);
967 void marshallAttributes(DOMElement* domElement) const {
968 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
971 void processAttribute(const DOMAttr* attribute) {
972 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
973 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
977 class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
978 public AbstractComplexElement,
979 public AbstractDOMCachingXMLObject,
980 public AbstractXMLObjectMarshaller,
981 public AbstractXMLObjectUnmarshaller
984 virtual ~EvidenceImpl() {}
986 EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
987 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
990 EvidenceImpl(const EvidenceImpl& src)
991 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
992 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
994 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
996 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1000 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1002 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1006 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1008 getAssertions().push_back(assertion->cloneAssertion());
1012 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1014 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1021 IMPL_XMLOBJECT_CLONE(Evidence);
1022 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1023 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1024 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1025 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1028 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1029 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1030 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1031 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1032 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1033 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1037 class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1038 public AbstractComplexElement,
1039 public AbstractDOMCachingXMLObject,
1040 public AbstractXMLObjectMarshaller,
1041 public AbstractXMLObjectUnmarshaller
1047 m_children.push_back(NULL);
1048 m_pos_Evidence=m_children.begin();
1051 virtual ~AuthzDecisionStatementImpl() {
1052 XMLString::release(&m_Resource);
1053 XMLString::release(&m_Decision);
1056 AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1057 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1061 AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1062 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1064 setResource(src.getResource());
1065 setDecision(src.getDecision());
1066 if (src.getEvidence())
1067 setEvidence(src.getEvidence()->cloneEvidence());
1068 VectorOf(Action) v=getActions();
1069 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1071 v.push_back((*i)->cloneAction());
1076 IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1077 Statement* cloneStatement() const {
1078 return cloneAuthzDecisionStatement();
1080 IMPL_STRING_ATTRIB(Resource);
1081 IMPL_STRING_ATTRIB(Decision);
1082 IMPL_TYPED_CHILD(Evidence);
1083 IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1086 void marshallAttributes(DOMElement* domElement) const {
1087 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1088 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1091 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1092 PROC_TYPED_CHILD(Evidence,SAML20_NS,false);
1093 PROC_TYPED_CHILDREN(Action,SAML20_NS,false);
1094 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1097 void processAttribute(const DOMAttr* attribute) {
1098 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1099 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1100 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1104 //TODO need unit test for this
1105 class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1108 virtual ~AttributeValueImpl() {}
1110 AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1111 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1114 AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1117 IMPL_XMLOBJECT_CLONE(AttributeValue);
1121 class SAML_DLLLOCAL AttributeImpl : public virtual Attribute,
1122 public AbstractComplexElement,
1123 public AbstractAttributeExtensibleXMLObject,
1124 public AbstractDOMCachingXMLObject,
1125 public AbstractXMLObjectMarshaller,
1126 public AbstractXMLObjectUnmarshaller
1129 m_Name=m_NameFormat=m_FriendlyName=NULL;
1132 virtual ~AttributeImpl() {
1133 XMLString::release(&m_Name);
1134 XMLString::release(&m_NameFormat);
1135 XMLString::release(&m_FriendlyName);
1138 AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1139 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1143 AttributeImpl(const AttributeImpl& src)
1144 : AbstractXMLObject(src), AbstractComplexElement(src),
1145 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1147 setName(src.getName());
1148 setNameFormat(src.getNameFormat());
1149 setFriendlyName(src.getFriendlyName());
1150 VectorOf(XMLObject) v=getAttributeValues();
1151 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1153 v.push_back((*i)->clone());
1158 IMPL_XMLOBJECT_CLONE(Attribute);
1159 IMPL_STRING_ATTRIB(Name);
1160 IMPL_STRING_ATTRIB(NameFormat);
1161 IMPL_STRING_ATTRIB(FriendlyName);
1162 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1164 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
1165 if (!qualifiedName.hasNamespaceURI()) {
1166 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1170 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1171 setNameFormat(value);
1174 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1175 setFriendlyName(value);
1179 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1183 void marshallAttributes(DOMElement* domElement) const {
1184 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1185 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1186 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1187 marshallExtensionAttributes(domElement);
1190 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1191 getAttributeValues().push_back(childXMLObject);
1194 void processAttribute(const DOMAttr* attribute) {
1195 unmarshallExtensionAttribute(attribute);
1199 //TODO unit test for this
1200 class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl
1203 virtual ~EncryptedAttributeImpl() {}
1205 EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1206 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1208 EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1210 IMPL_XMLOBJECT_CLONE(EncryptedAttribute);
1211 EncryptedElementType* cloneEncryptedElementType() const {
1212 return new EncryptedAttributeImpl(*this);
1216 class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement,
1217 public AbstractComplexElement,
1218 public AbstractDOMCachingXMLObject,
1219 public AbstractXMLObjectMarshaller,
1220 public AbstractXMLObjectUnmarshaller
1223 virtual ~AttributeStatementImpl() {}
1225 AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1226 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1229 AttributeStatementImpl(const AttributeStatementImpl& src)
1230 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1231 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1233 Attribute* attribute=dynamic_cast<Attribute*>(*i);
1235 getAttributes().push_back(attribute->cloneAttribute());
1239 EncryptedAttribute* enc=dynamic_cast<EncryptedAttribute*>(*i);
1241 getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute());
1248 IMPL_XMLOBJECT_CLONE(AttributeStatement);
1249 Statement* cloneStatement() const {
1250 return cloneAttributeStatement();
1252 IMPL_TYPED_CHILDREN(Attribute, m_children.end());
1253 IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end());
1256 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1257 PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false);
1258 PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false);
1259 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1263 class SAML_DLLLOCAL AdviceImpl : public virtual Advice,
1264 public AbstractComplexElement,
1265 public AbstractDOMCachingXMLObject,
1266 public AbstractXMLObjectMarshaller,
1267 public AbstractXMLObjectUnmarshaller
1270 virtual ~AdviceImpl() {}
1272 AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1273 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1276 AdviceImpl(const AdviceImpl& src)
1277 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1278 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1280 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1282 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1286 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1288 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1292 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1294 getAssertions().push_back(assertion->cloneAssertion());
1298 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1300 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1304 getOthers().push_back((*i)->clone());
1309 IMPL_XMLOBJECT_CLONE(Advice);
1310 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1311 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1312 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1313 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1314 IMPL_XMLOBJECT_CHILDREN(Other,m_children.end());
1317 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1318 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1319 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1320 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1321 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1324 const XMLCh* nsURI=root->getNamespaceURI();
1325 if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) {
1326 getOthers().push_back(childXMLObject);
1330 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1334 //TODO unit test for this
1335 class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl
1338 virtual ~EncryptedAssertionImpl() {}
1340 EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1341 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1343 EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1345 IMPL_XMLOBJECT_CLONE(EncryptedAssertion);
1346 EncryptedElementType* cloneEncryptedElementType() const {
1347 return new EncryptedAssertionImpl(*this);
1351 class SAML_DLLLOCAL AssertionImpl : public virtual Assertion,
1352 public AbstractComplexElement,
1353 public AbstractDOMCachingXMLObject,
1354 public AbstractXMLObjectMarshaller,
1355 public AbstractXMLObjectUnmarshaller
1360 m_IssueInstant=NULL;
1366 m_children.push_back(NULL);
1367 m_children.push_back(NULL);
1368 m_children.push_back(NULL);
1369 m_children.push_back(NULL);
1370 m_children.push_back(NULL);
1371 m_pos_Issuer=m_children.begin();
1372 m_pos_Signature=m_pos_Issuer;
1374 m_pos_Subject=m_pos_Signature;
1376 m_pos_Conditions=m_pos_Subject;
1378 m_pos_Advice=m_pos_Conditions;
1382 virtual ~AssertionImpl() {
1383 XMLString::release(&m_ID);
1384 XMLString::release(&m_Version);
1385 delete m_IssueInstant;
1388 AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1389 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1393 AssertionImpl(const AssertionImpl& src)
1394 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1396 setVersion(src.getVersion());
1398 setIssueInstant(src.getIssueInstant());
1399 if (src.getIssuer())
1400 setIssuer(src.getIssuer()->cloneIssuer());
1401 if (src.getSignature())
1402 setSignature(src.getSignature()->cloneSignature());
1403 if (src.getSubject())
1404 setSubject(src.getSubject()->cloneSubject());
1405 if (src.getConditions())
1406 setConditions(src.getConditions()->cloneConditions());
1407 if (src.getAdvice())
1408 setAdvice(src.getAdvice()->cloneAdvice());
1409 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1411 AuthnStatement* authst=dynamic_cast<AuthnStatement*>(*i);
1413 getAuthnStatements().push_back(authst->cloneAuthnStatement());
1417 AttributeStatement* attst=dynamic_cast<AttributeStatement*>(*i);
1419 getAttributeStatements().push_back(attst->cloneAttributeStatement());
1423 AuthzDecisionStatement* authzst=dynamic_cast<AuthzDecisionStatement*>(*i);
1425 getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement());
1429 Statement* st=dynamic_cast<Statement*>(*i);
1431 getStatements().push_back(st->cloneStatement());
1438 //IMPL_TYPED_CHILD(Signature);
1439 // Need customized setter.
1441 Signature* m_Signature;
1442 list<XMLObject*>::iterator m_pos_Signature;
1444 Signature* getSignature() const {
1448 void setSignature(Signature* sig) {
1449 prepareForAssignment(m_Signature,sig);
1450 *m_pos_Signature=m_Signature=sig;
1451 // Sync content reference back up.
1453 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1456 IMPL_XMLOBJECT_CLONE(Assertion);
1457 IMPL_STRING_ATTRIB(Version);
1459 IMPL_DATETIME_ATTRIB(IssueInstant,0);
1460 IMPL_TYPED_CHILD(Issuer);
1461 IMPL_TYPED_CHILD(Subject);
1462 IMPL_TYPED_CHILD(Conditions);
1463 IMPL_TYPED_CHILD(Advice);
1464 IMPL_TYPED_CHILDREN(Statement, m_children.end());
1465 IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end());
1466 IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end());
1467 IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end());
1470 void marshallAttributes(DOMElement* domElement) const {
1472 const_cast<AssertionImpl*>(this)->m_Version=XMLString::transcode("2.0");
1473 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1475 const_cast<AssertionImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1476 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1477 if (!m_IssueInstant) {
1478 const_cast<AssertionImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1479 const_cast<AssertionImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1481 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1484 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1485 PROC_TYPED_CHILD(Issuer,SAML20_NS,false);
1486 PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
1487 PROC_TYPED_CHILD(Subject,SAML20_NS,false);
1488 PROC_TYPED_CHILD(Conditions,SAML20_NS,false);
1489 PROC_TYPED_CHILD(Advice,SAML20_NS,false);
1490 PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false);
1491 PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false);
1492 PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false);
1493 PROC_TYPED_CHILDREN(Statement,SAML20_NS,false);
1494 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1497 void processAttribute(const DOMAttr* attribute) {
1498 PROC_STRING_ATTRIB(Version,VER,NULL);
1499 PROC_ID_ATTRIB(ID,ID,NULL);
1500 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1501 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1508 #if defined (_MSC_VER)
1509 #pragma warning( pop )
1512 // Builder Implementations
1514 IMPL_XMLOBJECTBUILDER(Action);
1515 IMPL_XMLOBJECTBUILDER(Advice);
1516 IMPL_XMLOBJECTBUILDER(Assertion);
1517 IMPL_XMLOBJECTBUILDER(AssertionIDRef);
1518 IMPL_XMLOBJECTBUILDER(AssertionURIRef);
1519 IMPL_XMLOBJECTBUILDER(Attribute);
1520 IMPL_XMLOBJECTBUILDER(AttributeStatement);
1521 IMPL_XMLOBJECTBUILDER(AttributeValue);
1522 IMPL_XMLOBJECTBUILDER(Audience);
1523 IMPL_XMLOBJECTBUILDER(AudienceRestriction);
1524 IMPL_XMLOBJECTBUILDER(AuthenticatingAuthority);
1525 IMPL_XMLOBJECTBUILDER(AuthnContext);
1526 IMPL_XMLOBJECTBUILDER(AuthnContextClassRef);
1527 IMPL_XMLOBJECTBUILDER(AuthnContextDecl);
1528 IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef);
1529 IMPL_XMLOBJECTBUILDER(AuthnStatement);
1530 IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement);
1531 IMPL_XMLOBJECTBUILDER(Conditions);
1532 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1533 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1534 IMPL_XMLOBJECTBUILDER(EncryptedID);
1535 IMPL_XMLOBJECTBUILDER(Evidence);
1536 IMPL_XMLOBJECTBUILDER(Issuer);
1537 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1538 IMPL_XMLOBJECTBUILDER(NameID);
1539 IMPL_XMLOBJECTBUILDER(NameIDType);
1540 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1541 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1542 IMPL_XMLOBJECTBUILDER(Subject);
1543 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1544 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1545 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1548 const XMLCh Action::LOCAL_NAME[] = UNICODE_LITERAL_6(A,c,t,i,o,n);
1549 const XMLCh Action::TYPE_NAME[] = UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1550 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1551 const XMLCh Advice::LOCAL_NAME[] = UNICODE_LITERAL_6(A,d,v,i,c,e);
1552 const XMLCh Advice::TYPE_NAME[] = UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1553 const XMLCh Assertion::LOCAL_NAME[] = UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1554 const XMLCh Assertion::TYPE_NAME[] = UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1555 const XMLCh Assertion::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1556 const XMLCh Assertion::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1557 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1558 const XMLCh AssertionIDRef::LOCAL_NAME[] = UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1559 const XMLCh AssertionURIRef::LOCAL_NAME[] = UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1560 const XMLCh Attribute::LOCAL_NAME[] = UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1561 const XMLCh Attribute::TYPE_NAME[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1562 const XMLCh Attribute::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
1563 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1564 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1565 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);
1566 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);
1567 const XMLCh AttributeValue::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1568 const XMLCh Audience::LOCAL_NAME[] = UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1569 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);
1570 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);
1571 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);
1572 const XMLCh AuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1573 const XMLCh AuthnContext::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1574 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);
1575 const XMLCh AuthnContextDecl::LOCAL_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1576 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);
1577 const XMLCh AuthnStatement::LOCAL_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1578 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);
1579 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1580 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1581 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);
1582 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);
1583 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);
1584 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1585 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] = UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1586 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1587 const XMLCh AuthzDecisionStatement::DECISION_DENY[] = UNICODE_LITERAL_4(D,e,n,y);
1588 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] = UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1589 const XMLCh BaseID::LOCAL_NAME[] = UNICODE_LITERAL_6(B,a,s,e,I,D);
1590 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1591 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1592 const XMLCh Condition::LOCAL_NAME[] = UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1593 const XMLCh Conditions::LOCAL_NAME[] = UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1594 const XMLCh Conditions::TYPE_NAME[] = UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1595 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1596 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1597 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);
1598 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);
1599 const XMLCh EncryptedElementType::LOCAL_NAME[] = {chNull};
1600 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);
1601 const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,d);
1602 const XMLCh Evidence::LOCAL_NAME[] = UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1603 const XMLCh Evidence::TYPE_NAME[] = UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1604 const XMLCh Issuer::LOCAL_NAME[] = UNICODE_LITERAL_6(I,s,s,u,e,r);
1605 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);
1606 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);
1607 const XMLCh KeyInfoConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1608 const XMLCh KeyInfoConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1609 const XMLCh KeyInfoConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1610 const XMLCh KeyInfoConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1611 const XMLCh KeyInfoConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1612 const XMLCh NameID::LOCAL_NAME[] = UNICODE_LITERAL_6(N,a,m,e,I,D);
1613 const XMLCh NameIDType::LOCAL_NAME[] = {chNull};
1614 const XMLCh NameIDType::TYPE_NAME[] = UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1615 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1616 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1617 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
1618 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1619 const XMLCh OneTimeUse::LOCAL_NAME[] = UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1620 const XMLCh OneTimeUse::TYPE_NAME[] = UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1621 const XMLCh ProxyRestriction::LOCAL_NAME[] = UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1622 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);
1623 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1624 const XMLCh Statement::LOCAL_NAME[] = UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1625 const XMLCh Subject::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1626 const XMLCh Subject::TYPE_NAME[] = UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1627 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);
1628 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);
1629 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1630 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);
1631 const XMLCh SubjectConfirmationData::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1632 const XMLCh SubjectConfirmationData::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1633 const XMLCh SubjectConfirmationData::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1634 const XMLCh SubjectConfirmationData::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1635 const XMLCh SubjectConfirmationData::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1636 const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1637 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);
1638 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1639 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1641 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1642 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1643 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1644 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1645 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1646 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1647 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
1650 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1651 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1652 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1653 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1654 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1655 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1656 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
1659 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1660 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1661 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1662 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1663 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1664 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1665 chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1666 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1669 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1670 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1671 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1672 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1673 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1674 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1675 chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1676 chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1677 chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1678 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1681 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1682 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1683 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1684 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1685 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1686 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1687 chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1690 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1691 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1692 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1693 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1694 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1695 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1696 chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1699 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1700 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1701 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1702 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1703 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1704 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1705 chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1708 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1709 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1710 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1711 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1712 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1713 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1714 chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1717 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1718 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1719 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1720 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1721 chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1724 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1725 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1726 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1727 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1728 chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1729 chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1732 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1733 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1734 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1735 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1736 chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1737 chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1740 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1741 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1742 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1743 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1744 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1745 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1748 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1749 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1750 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1751 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1752 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1753 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1754 chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1757 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1758 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1759 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1760 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1761 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1762 chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1765 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1766 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1767 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1768 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1769 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1770 chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1773 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1774 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1775 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1776 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1777 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1778 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1779 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
1782 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1783 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1784 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1785 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1786 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1787 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1788 chLatin_u, chLatin_r, chLatin_i, chNull
1791 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1792 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1793 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1794 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1795 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1796 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1797 chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull