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/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>
37 #include <xercesc/util/XMLUniDefs.hpp>
39 using namespace opensaml::saml2;
40 using namespace opensaml;
41 using namespace xmlencryption;
42 using namespace xmlsignature;
43 using namespace xmltooling;
45 using xmlconstants::XMLSIG_NS;
46 using xmlconstants::XMLENC_NS;
47 using samlconstants::SAML20_NS;
49 #if defined (_MSC_VER)
50 #pragma warning( push )
51 #pragma warning( disable : 4250 4251 )
57 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextClassRef);
61 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextDeclRef);
62 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthenticatingAuthority);
64 class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType,
65 public AbstractSimpleElement,
66 public AbstractDOMCachingXMLObject,
67 public AbstractXMLObjectMarshaller,
68 public AbstractXMLObjectUnmarshaller
71 m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL;
80 virtual ~NameIDTypeImpl() {
81 XMLString::release(&m_NameQualifier);
82 XMLString::release(&m_SPNameQualifier);
83 XMLString::release(&m_Format);
84 XMLString::release(&m_SPProvidedID);
87 NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
88 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
92 NameIDTypeImpl(const NameIDTypeImpl& src)
93 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
95 setNameQualifier(src.getNameQualifier());
96 setSPNameQualifier(src.getSPNameQualifier());
97 setFormat(src.getFormat());
98 setSPProvidedID(src.getSPProvidedID());
101 IMPL_XMLOBJECT_CLONE(NameIDType);
102 IMPL_STRING_ATTRIB(NameQualifier);
103 IMPL_STRING_ATTRIB(SPNameQualifier);
104 IMPL_STRING_ATTRIB(Format);
105 IMPL_STRING_ATTRIB(SPProvidedID);
108 void marshallAttributes(DOMElement* domElement) const {
109 MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
110 MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
111 MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
112 MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
115 void processAttribute(const DOMAttr* attribute) {
116 PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
117 PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
118 PROC_STRING_ATTRIB(Format,FORMAT,NULL);
119 PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
120 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
124 class SAML_DLLLOCAL NameIDImpl : public virtual NameID, public NameIDTypeImpl
127 virtual ~NameIDImpl() {}
129 NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
130 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
132 NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
134 IMPL_XMLOBJECT_CLONE(NameID);
135 NameIDType* cloneNameIDType() const {
136 return new NameIDImpl(*this);
140 class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl
143 virtual ~IssuerImpl() {}
145 IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
146 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
148 IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
150 IMPL_XMLOBJECT_CLONE(Issuer);
151 NameIDType* cloneNameIDType() const {
152 return new IssuerImpl(*this);
156 //TODO unit test for this
157 // - need to test encryption/decryption too, or already done in xmltooling ?
158 class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType,
159 public AbstractComplexElement,
160 public AbstractDOMCachingXMLObject,
161 public AbstractXMLObjectMarshaller,
162 public AbstractXMLObjectUnmarshaller
165 m_EncryptedData=NULL;
166 m_children.push_back(NULL);
167 m_pos_EncryptedData=m_children.begin();
171 EncryptedElementTypeImpl() {
176 virtual ~EncryptedElementTypeImpl() {}
178 EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
179 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
183 EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src)
184 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
186 if (src.getEncryptedData())
187 setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
188 VectorOf(EncryptedKey) v=getEncryptedKeys();
189 for (vector<EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
191 v.push_back((*i)->cloneEncryptedKey());
196 XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
198 if (!m_EncryptedData)
199 throw DecryptionException("No encrypted data present.");
200 Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
201 DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
202 if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
203 DOMNode* plaintext=frag->getFirstChild();
204 if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
205 auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
206 ret->releaseThisAndChildrenDOM();
207 return ret.release();
211 throw DecryptionException("Decryption did not result in a single element.");
214 IMPL_XMLOBJECT_CLONE(EncryptedElementType);
215 IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
216 IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
219 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
220 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
221 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
222 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
226 //TODO unit test for this
227 class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
230 virtual ~EncryptedIDImpl() {}
232 EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
233 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
235 EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
237 IMPL_XMLOBJECT_CLONE(EncryptedID);
238 EncryptedElementType* cloneEncryptedElementType() const {
239 return new EncryptedIDImpl(*this);
243 class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction,
244 public AbstractComplexElement,
245 public AbstractDOMCachingXMLObject,
246 public AbstractXMLObjectMarshaller,
247 public AbstractXMLObjectUnmarshaller
250 virtual ~AudienceRestrictionImpl() {}
252 AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
253 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
256 AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
257 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
258 VectorOf(Audience) v=getAudiences();
259 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
261 v.push_back((*i)->cloneAudience());
266 IMPL_XMLOBJECT_CLONE(AudienceRestriction);
267 Condition* cloneCondition() const {
268 return cloneAudienceRestriction();
270 IMPL_TYPED_CHILDREN(Audience,m_children.end());
273 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
274 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
275 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
279 class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
280 public AbstractSimpleElement,
281 public AbstractDOMCachingXMLObject,
282 public AbstractXMLObjectMarshaller,
283 public AbstractXMLObjectUnmarshaller
286 virtual ~OneTimeUseImpl() {}
288 OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
289 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
292 OneTimeUseImpl(const OneTimeUseImpl& src)
293 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
296 IMPL_XMLOBJECT_CLONE(OneTimeUse);
297 Condition* cloneCondition() const {
298 return cloneOneTimeUse();
302 class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
303 public AbstractComplexElement,
304 public AbstractDOMCachingXMLObject,
305 public AbstractXMLObjectMarshaller,
306 public AbstractXMLObjectUnmarshaller
309 virtual ~ProxyRestrictionImpl() {
310 XMLString::release(&m_Count);
313 ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
314 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
318 ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
319 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
320 setCount(src.m_Count);
321 VectorOf(Audience) v=getAudiences();
322 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
324 v.push_back((*i)->cloneAudience());
329 IMPL_XMLOBJECT_CLONE(ProxyRestriction);
330 Condition* cloneCondition() const {
331 return cloneProxyRestriction();
333 IMPL_TYPED_CHILDREN(Audience,m_children.end());
334 IMPL_INTEGER_ATTRIB(Count);
337 void marshallAttributes(DOMElement* domElement) const {
338 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
341 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
342 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
343 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
346 void processAttribute(const DOMAttr* attribute) {
347 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
348 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
353 class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
354 public AbstractComplexElement,
355 public AbstractDOMCachingXMLObject,
356 public AbstractXMLObjectMarshaller,
357 public AbstractXMLObjectUnmarshaller
360 m_NotBefore=m_NotOnOrAfter=NULL;
363 virtual ~ConditionsImpl() {
365 delete m_NotOnOrAfter;
368 ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
369 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
373 ConditionsImpl(const ConditionsImpl& src)
374 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
376 setNotBefore(src.getNotBefore());
377 setNotOnOrAfter(src.getNotOnOrAfter());
379 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
381 AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
383 getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
387 OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
389 getOneTimeUses().push_back(dncc->cloneOneTimeUse());
393 ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
395 getProxyRestrictions().push_back(prc->cloneProxyRestriction());
399 Condition* c=dynamic_cast<Condition*>(*i);
401 getConditions().push_back(c->cloneCondition());
408 IMPL_XMLOBJECT_CLONE(Conditions);
409 IMPL_DATETIME_ATTRIB(NotBefore,0);
410 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
411 IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
412 IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
413 IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
414 IMPL_TYPED_CHILDREN(Condition,m_children.end());
417 void marshallAttributes(DOMElement* domElement) const {
418 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
419 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
422 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
423 PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false);
424 PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false);
425 PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false);
426 PROC_TYPED_CHILDREN(Condition,SAML20_NS,false);
427 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
430 void processAttribute(const DOMAttr* attribute) {
431 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
432 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
433 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
437 class SAML_DLLLOCAL SubjectConfirmationDataImpl : public virtual SubjectConfirmationData, public AnyElementImpl
440 m_NotBefore=m_NotOnOrAfter=NULL;
441 m_Recipient=m_InResponseTo=m_Address=NULL;
444 virtual ~SubjectConfirmationDataImpl() {
446 delete m_NotOnOrAfter;
447 XMLString::release(&m_Recipient);
448 XMLString::release(&m_InResponseTo);
449 XMLString::release(&m_Address);
452 SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
453 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
457 SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src) : AnyElementImpl(src) {
459 setNotBefore(src.getNotBefore());
460 setNotOnOrAfter(src.getNotOnOrAfter());
461 setRecipient(src.getRecipient());
462 setInResponseTo(src.getInResponseTo());
463 setAddress(src.getAddress());
466 IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
467 IMPL_DATETIME_ATTRIB(NotBefore,0);
468 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
469 IMPL_STRING_ATTRIB(Recipient);
470 IMPL_STRING_ATTRIB(InResponseTo);
471 IMPL_STRING_ATTRIB(Address);
474 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
475 if (!qualifiedName.hasNamespaceURI()) {
476 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
480 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
481 setNotOnOrAfter(value);
484 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
488 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
489 setInResponseTo(value);
492 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
497 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
501 void marshallAttributes(DOMElement* domElement) const {
502 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
503 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
504 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
505 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
506 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
507 AnyElementImpl::marshallAttributes(domElement);
510 // The processAttributes hook is handled by AnyElementImpl
513 class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
514 public AbstractComplexElement,
515 public AbstractAttributeExtensibleXMLObject,
516 public AbstractDOMCachingXMLObject,
517 public AbstractXMLObjectMarshaller,
518 public AbstractXMLObjectUnmarshaller
521 m_NotBefore=m_NotOnOrAfter=NULL;
522 m_Recipient=m_InResponseTo=m_Address=NULL;
525 virtual ~KeyInfoConfirmationDataTypeImpl() {
527 delete m_NotOnOrAfter;
528 XMLString::release(&m_Recipient);
529 XMLString::release(&m_InResponseTo);
530 XMLString::release(&m_Address);
533 KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
534 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
538 KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
539 : AbstractXMLObject(src), AbstractComplexElement(src),
540 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
542 setNotBefore(src.getNotBefore());
543 setNotOnOrAfter(src.getNotOnOrAfter());
544 setRecipient(src.getRecipient());
545 setInResponseTo(src.getInResponseTo());
546 setAddress(src.getAddress());
547 VectorOf(KeyInfo) v=getKeyInfos();
548 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
549 v.push_back((*i)->cloneKeyInfo());
552 IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
553 IMPL_DATETIME_ATTRIB(NotBefore,0);
554 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
555 IMPL_STRING_ATTRIB(Recipient);
556 IMPL_STRING_ATTRIB(InResponseTo);
557 IMPL_STRING_ATTRIB(Address);
558 IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
561 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
562 if (!qualifiedName.hasNamespaceURI()) {
563 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
567 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
568 setNotOnOrAfter(value);
571 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
575 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
576 setInResponseTo(value);
579 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
584 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
588 void marshallAttributes(DOMElement* domElement) const {
589 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
590 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
591 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
592 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
593 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
594 marshallExtensionAttributes(domElement);
597 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
598 PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false);
599 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
602 void processAttribute(const DOMAttr* attribute) {
603 unmarshallExtensionAttribute(attribute);
607 class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
608 public AbstractComplexElement,
609 public AbstractDOMCachingXMLObject,
610 public AbstractXMLObjectMarshaller,
611 public AbstractXMLObjectUnmarshaller
618 m_SubjectConfirmationData=NULL;
619 m_KeyInfoConfirmationDataType=NULL;
620 m_children.push_back(NULL);
621 m_children.push_back(NULL);
622 m_children.push_back(NULL);
623 m_children.push_back(NULL);
624 m_pos_BaseID=m_children.begin();
625 m_pos_NameID=m_pos_BaseID;
627 m_pos_EncryptedID=m_pos_NameID;
629 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
630 ++m_pos_SubjectConfirmationData;
631 m_pos_KeyInfoConfirmationDataType=m_pos_SubjectConfirmationData;
632 ++m_pos_KeyInfoConfirmationDataType;
635 virtual ~SubjectConfirmationImpl() {}
637 SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
638 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
642 SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
643 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
645 setMethod(src.getMethod());
647 setBaseID(src.getBaseID()->cloneBaseID());
649 setNameID(src.getNameID()->cloneNameID());
650 if (src.getEncryptedID())
651 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
652 if (src.getSubjectConfirmationData())
653 setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
654 if (src.getKeyInfoConfirmationDataType())
655 setKeyInfoConfirmationDataType(src.getKeyInfoConfirmationDataType()->cloneKeyInfoConfirmationDataType());
658 IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
659 IMPL_STRING_ATTRIB(Method);
660 IMPL_TYPED_CHILD(BaseID);
661 IMPL_TYPED_CHILD(NameID);
662 IMPL_TYPED_CHILD(EncryptedID);
663 IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
664 IMPL_TYPED_CHILD(KeyInfoConfirmationDataType);
667 void marshallAttributes(DOMElement* domElement) const {
668 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
671 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
672 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
673 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
674 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
675 PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAML20_NS,false);
676 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS);
677 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
680 void processAttribute(const DOMAttr* attribute) {
681 PROC_STRING_ATTRIB(Method,METHOD,NULL);
682 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
686 class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
687 public AbstractComplexElement,
688 public AbstractDOMCachingXMLObject,
689 public AbstractXMLObjectMarshaller,
690 public AbstractXMLObjectUnmarshaller
696 m_children.push_back(NULL);
697 m_children.push_back(NULL);
698 m_children.push_back(NULL);
699 m_pos_BaseID=m_children.begin();
700 m_pos_NameID=m_pos_BaseID;
702 m_pos_EncryptedID=m_pos_NameID;
706 virtual ~SubjectImpl() {}
708 SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
709 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
713 SubjectImpl(const SubjectImpl& src)
714 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
717 setBaseID(src.getBaseID()->cloneBaseID());
719 setNameID(src.getNameID()->cloneNameID());
720 if (src.getEncryptedID())
721 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
722 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
723 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
725 v.push_back((*i)->cloneSubjectConfirmation());
730 IMPL_XMLOBJECT_CLONE(Subject);
731 IMPL_TYPED_CHILD(NameID);
732 IMPL_TYPED_CHILD(BaseID);
733 IMPL_TYPED_CHILD(EncryptedID);
734 IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
737 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
738 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
739 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
740 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
741 PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false);
742 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
746 class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
747 public AbstractSimpleElement,
748 public AbstractDOMCachingXMLObject,
749 public AbstractXMLObjectMarshaller,
750 public AbstractXMLObjectUnmarshaller
753 m_Address=m_DNSName=NULL;
756 virtual ~SubjectLocalityImpl() {
757 XMLString::release(&m_Address);
758 XMLString::release(&m_DNSName);
761 SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
762 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
766 SubjectLocalityImpl(const SubjectLocalityImpl& src)
767 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
769 setAddress(src.getAddress());
770 setDNSName(src.getDNSName());
773 IMPL_XMLOBJECT_CLONE(SubjectLocality);
774 IMPL_STRING_ATTRIB(Address);
775 IMPL_STRING_ATTRIB(DNSName);
778 void marshallAttributes(DOMElement* domElement) const {
779 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
780 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
783 void processAttribute(const DOMAttr* attribute) {
784 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
785 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
786 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
790 //TODO need unit test for this
791 class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
794 virtual ~AuthnContextDeclImpl() {}
796 AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
797 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
800 AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
803 IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
806 class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
807 public AbstractComplexElement,
808 public AbstractDOMCachingXMLObject,
809 public AbstractXMLObjectMarshaller,
810 public AbstractXMLObjectUnmarshaller
813 m_AuthnContextClassRef=NULL;
814 m_AuthnContextDecl=NULL;
815 m_AuthnContextDeclRef=NULL;
816 m_children.push_back(NULL);
817 m_children.push_back(NULL);
818 m_children.push_back(NULL);
819 m_pos_AuthnContextClassRef=m_children.begin();
820 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
821 ++m_pos_AuthnContextDecl;
822 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
823 ++m_pos_AuthnContextDeclRef;
826 virtual ~AuthnContextImpl() {}
828 AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
829 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
833 AuthnContextImpl(const AuthnContextImpl& src)
834 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
836 if (src.getAuthnContextClassRef())
837 setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
838 if (src.getAuthnContextDecl())
839 setAuthnContextDecl(src.getAuthnContextDecl()->clone());
840 if (src.getAuthnContextDeclRef())
841 setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
842 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
843 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
845 v.push_back((*i)->cloneAuthenticatingAuthority());
850 IMPL_XMLOBJECT_CLONE(AuthnContext);
851 IMPL_TYPED_CHILD(AuthnContextClassRef);
852 IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
853 IMPL_TYPED_CHILD(AuthnContextDeclRef);
854 IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
857 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
858 PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false);
859 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS);
860 PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false);
861 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false);
862 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
866 class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
867 public AbstractComplexElement,
868 public AbstractDOMCachingXMLObject,
869 public AbstractXMLObjectMarshaller,
870 public AbstractXMLObjectUnmarshaller
875 m_SessionNotOnOrAfter=NULL;
876 m_SubjectLocality=NULL;
878 m_children.push_back(NULL);
879 m_children.push_back(NULL);
880 m_pos_SubjectLocality=m_children.begin();
881 m_pos_AuthnContext=m_pos_SubjectLocality;
882 ++m_pos_AuthnContext;
885 virtual ~AuthnStatementImpl() {
886 delete m_AuthnInstant;
887 XMLString::release(&m_SessionIndex);
888 delete m_SessionNotOnOrAfter;
891 AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
892 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
896 AuthnStatementImpl(const AuthnStatementImpl& src)
897 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
899 setAuthnInstant(src.getAuthnInstant());
900 setSessionIndex(src.getSessionIndex());
901 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
902 if (src.getSubjectLocality())
903 setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
904 if (src.getAuthnContext())
905 setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
908 IMPL_XMLOBJECT_CLONE(AuthnStatement);
909 Statement* cloneStatement() const {
910 return cloneAuthnStatement();
912 IMPL_DATETIME_ATTRIB(AuthnInstant,0);
913 IMPL_STRING_ATTRIB(SessionIndex);
914 IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
915 IMPL_TYPED_CHILD(SubjectLocality);
916 IMPL_TYPED_CHILD(AuthnContext);
919 void marshallAttributes(DOMElement* domElement) const {
920 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
921 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
922 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
925 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
926 PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false);
927 PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false);
928 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
931 void processAttribute(const DOMAttr* attribute) {
932 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
933 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
934 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
935 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
939 class SAML_DLLLOCAL ActionImpl : public virtual Action,
940 public AbstractSimpleElement,
941 public AbstractDOMCachingXMLObject,
942 public AbstractXMLObjectMarshaller,
943 public AbstractXMLObjectUnmarshaller
946 virtual ~ActionImpl() {
947 XMLString::release(&m_Namespace);
950 ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
951 : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
954 ActionImpl(const ActionImpl& src)
955 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
956 setNamespace(src.getNamespace());
959 IMPL_XMLOBJECT_CLONE(Action);
960 IMPL_STRING_ATTRIB(Namespace);
963 void marshallAttributes(DOMElement* domElement) const {
964 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
967 void processAttribute(const DOMAttr* attribute) {
968 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
969 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
973 class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
974 public AbstractComplexElement,
975 public AbstractDOMCachingXMLObject,
976 public AbstractXMLObjectMarshaller,
977 public AbstractXMLObjectUnmarshaller
980 virtual ~EvidenceImpl() {}
982 EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
983 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
986 EvidenceImpl(const EvidenceImpl& src)
987 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
988 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
990 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
992 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
996 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
998 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1002 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1004 getAssertions().push_back(assertion->cloneAssertion());
1008 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1010 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1017 IMPL_XMLOBJECT_CLONE(Evidence);
1018 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1019 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1020 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1021 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1024 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1025 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1026 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1027 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1028 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1029 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1033 class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1034 public AbstractComplexElement,
1035 public AbstractDOMCachingXMLObject,
1036 public AbstractXMLObjectMarshaller,
1037 public AbstractXMLObjectUnmarshaller
1043 m_children.push_back(NULL);
1044 m_pos_Evidence=m_children.begin();
1047 virtual ~AuthzDecisionStatementImpl() {
1048 XMLString::release(&m_Resource);
1049 XMLString::release(&m_Decision);
1052 AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1053 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1057 AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1058 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1060 setResource(src.getResource());
1061 setDecision(src.getDecision());
1062 if (src.getEvidence())
1063 setEvidence(src.getEvidence()->cloneEvidence());
1064 VectorOf(Action) v=getActions();
1065 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1067 v.push_back((*i)->cloneAction());
1072 IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1073 Statement* cloneStatement() const {
1074 return cloneAuthzDecisionStatement();
1076 IMPL_STRING_ATTRIB(Resource);
1077 IMPL_STRING_ATTRIB(Decision);
1078 IMPL_TYPED_CHILD(Evidence);
1079 IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1082 void marshallAttributes(DOMElement* domElement) const {
1083 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1084 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1087 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1088 PROC_TYPED_CHILD(Evidence,SAML20_NS,false);
1089 PROC_TYPED_CHILDREN(Action,SAML20_NS,false);
1090 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1093 void processAttribute(const DOMAttr* attribute) {
1094 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1095 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1096 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1100 //TODO need unit test for this
1101 class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1104 virtual ~AttributeValueImpl() {}
1106 AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1107 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1110 AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1113 IMPL_XMLOBJECT_CLONE(AttributeValue);
1117 class SAML_DLLLOCAL AttributeImpl : public virtual Attribute,
1118 public AbstractComplexElement,
1119 public AbstractAttributeExtensibleXMLObject,
1120 public AbstractDOMCachingXMLObject,
1121 public AbstractXMLObjectMarshaller,
1122 public AbstractXMLObjectUnmarshaller
1125 m_Name=m_NameFormat=m_FriendlyName=NULL;
1128 virtual ~AttributeImpl() {
1129 XMLString::release(&m_Name);
1130 XMLString::release(&m_NameFormat);
1131 XMLString::release(&m_FriendlyName);
1134 AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1135 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1139 AttributeImpl(const AttributeImpl& src)
1140 : AbstractXMLObject(src), AbstractComplexElement(src),
1141 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1143 setName(src.getName());
1144 setNameFormat(src.getNameFormat());
1145 setFriendlyName(src.getFriendlyName());
1146 VectorOf(XMLObject) v=getAttributeValues();
1147 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1149 v.push_back((*i)->clone());
1154 IMPL_XMLOBJECT_CLONE(Attribute);
1155 IMPL_STRING_ATTRIB(Name);
1156 IMPL_STRING_ATTRIB(NameFormat);
1157 IMPL_STRING_ATTRIB(FriendlyName);
1158 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1160 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
1161 if (!qualifiedName.hasNamespaceURI()) {
1162 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1166 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1167 setNameFormat(value);
1170 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1171 setFriendlyName(value);
1175 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1179 void marshallAttributes(DOMElement* domElement) const {
1180 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1181 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1182 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1183 marshallExtensionAttributes(domElement);
1186 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1187 getAttributeValues().push_back(childXMLObject);
1190 void processAttribute(const DOMAttr* attribute) {
1191 unmarshallExtensionAttribute(attribute);
1195 //TODO unit test for this
1196 class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl
1199 virtual ~EncryptedAttributeImpl() {}
1201 EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1202 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1204 EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1206 IMPL_XMLOBJECT_CLONE(EncryptedAttribute);
1207 EncryptedElementType* cloneEncryptedElementType() const {
1208 return new EncryptedAttributeImpl(*this);
1212 class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement,
1213 public AbstractComplexElement,
1214 public AbstractDOMCachingXMLObject,
1215 public AbstractXMLObjectMarshaller,
1216 public AbstractXMLObjectUnmarshaller
1219 virtual ~AttributeStatementImpl() {}
1221 AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1222 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1225 AttributeStatementImpl(const AttributeStatementImpl& src)
1226 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1227 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1229 Attribute* attribute=dynamic_cast<Attribute*>(*i);
1231 getAttributes().push_back(attribute->cloneAttribute());
1235 EncryptedAttribute* enc=dynamic_cast<EncryptedAttribute*>(*i);
1237 getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute());
1244 IMPL_XMLOBJECT_CLONE(AttributeStatement);
1245 Statement* cloneStatement() const {
1246 return cloneAttributeStatement();
1248 IMPL_TYPED_CHILDREN(Attribute, m_children.end());
1249 IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end());
1252 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1253 PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false);
1254 PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false);
1255 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1259 class SAML_DLLLOCAL AdviceImpl : public virtual Advice,
1260 public AbstractComplexElement,
1261 public AbstractDOMCachingXMLObject,
1262 public AbstractXMLObjectMarshaller,
1263 public AbstractXMLObjectUnmarshaller
1266 virtual ~AdviceImpl() {}
1268 AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1269 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1272 AdviceImpl(const AdviceImpl& src)
1273 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1274 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1276 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1278 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1282 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1284 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1288 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1290 getAssertions().push_back(assertion->cloneAssertion());
1294 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1296 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1300 getUnknownXMLObjects().push_back((*i)->clone());
1305 IMPL_XMLOBJECT_CLONE(Advice);
1306 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1307 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1308 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1309 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1310 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
1313 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1314 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1315 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1316 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1317 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1320 const XMLCh* nsURI=root->getNamespaceURI();
1321 if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) {
1322 getUnknownXMLObjects().push_back(childXMLObject);
1326 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1330 //TODO unit test for this
1331 class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl
1334 virtual ~EncryptedAssertionImpl() {}
1336 EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1337 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1339 EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1341 IMPL_XMLOBJECT_CLONE(EncryptedAssertion);
1342 EncryptedElementType* cloneEncryptedElementType() const {
1343 return new EncryptedAssertionImpl(*this);
1347 class SAML_DLLLOCAL AssertionImpl : public virtual Assertion,
1348 public AbstractComplexElement,
1349 public AbstractDOMCachingXMLObject,
1350 public AbstractXMLObjectMarshaller,
1351 public AbstractXMLObjectUnmarshaller
1356 m_IssueInstant=NULL;
1362 m_children.push_back(NULL);
1363 m_children.push_back(NULL);
1364 m_children.push_back(NULL);
1365 m_children.push_back(NULL);
1366 m_children.push_back(NULL);
1367 m_pos_Issuer=m_children.begin();
1368 m_pos_Signature=m_pos_Issuer;
1370 m_pos_Subject=m_pos_Signature;
1372 m_pos_Conditions=m_pos_Subject;
1374 m_pos_Advice=m_pos_Conditions;
1378 virtual ~AssertionImpl() {
1379 XMLString::release(&m_ID);
1380 XMLString::release(&m_Version);
1381 delete m_IssueInstant;
1384 AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1385 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1389 AssertionImpl(const AssertionImpl& src)
1390 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1392 setVersion(src.getVersion());
1394 setIssueInstant(src.getIssueInstant());
1395 if (src.getIssuer())
1396 setIssuer(src.getIssuer()->cloneIssuer());
1397 if (src.getSignature())
1398 setSignature(src.getSignature()->cloneSignature());
1399 if (src.getSubject())
1400 setSubject(src.getSubject()->cloneSubject());
1401 if (src.getConditions())
1402 setConditions(src.getConditions()->cloneConditions());
1403 if (src.getAdvice())
1404 setAdvice(src.getAdvice()->cloneAdvice());
1405 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1407 AuthnStatement* authst=dynamic_cast<AuthnStatement*>(*i);
1409 getAuthnStatements().push_back(authst->cloneAuthnStatement());
1413 AttributeStatement* attst=dynamic_cast<AttributeStatement*>(*i);
1415 getAttributeStatements().push_back(attst->cloneAttributeStatement());
1419 AuthzDecisionStatement* authzst=dynamic_cast<AuthzDecisionStatement*>(*i);
1421 getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement());
1425 Statement* st=dynamic_cast<Statement*>(*i);
1427 getStatements().push_back(st->cloneStatement());
1434 //IMPL_TYPED_CHILD(Signature);
1435 // Need customized setter.
1437 Signature* m_Signature;
1438 list<XMLObject*>::iterator m_pos_Signature;
1440 Signature* getSignature() const {
1444 void setSignature(Signature* sig) {
1445 prepareForAssignment(m_Signature,sig);
1446 *m_pos_Signature=m_Signature=sig;
1447 // Sync content reference back up.
1449 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1452 IMPL_XMLOBJECT_CLONE(Assertion);
1453 IMPL_STRING_ATTRIB(Version);
1455 IMPL_DATETIME_ATTRIB(IssueInstant,0);
1456 IMPL_TYPED_CHILD(Issuer);
1457 IMPL_TYPED_CHILD(Subject);
1458 IMPL_TYPED_CHILD(Conditions);
1459 IMPL_TYPED_CHILD(Advice);
1460 IMPL_TYPED_CHILDREN(Statement, m_children.end());
1461 IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end());
1462 IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end());
1463 IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end());
1466 void marshallAttributes(DOMElement* domElement) const {
1468 const_cast<AssertionImpl*>(this)->m_Version=XMLString::transcode("2.0");
1469 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1471 const_cast<AssertionImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1472 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1473 if (!m_IssueInstant) {
1474 const_cast<AssertionImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1475 const_cast<AssertionImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1477 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1480 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1481 PROC_TYPED_CHILD(Issuer,SAML20_NS,false);
1482 PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
1483 PROC_TYPED_CHILD(Subject,SAML20_NS,false);
1484 PROC_TYPED_CHILD(Conditions,SAML20_NS,false);
1485 PROC_TYPED_CHILD(Advice,SAML20_NS,false);
1486 PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false);
1487 PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false);
1488 PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false);
1489 PROC_TYPED_CHILDREN(Statement,SAML20_NS,false);
1490 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1493 void processAttribute(const DOMAttr* attribute) {
1494 PROC_STRING_ATTRIB(Version,VER,NULL);
1495 PROC_ID_ATTRIB(ID,ID,NULL);
1496 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1497 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1504 #if defined (_MSC_VER)
1505 #pragma warning( pop )
1508 // Builder Implementations
1510 IMPL_XMLOBJECTBUILDER(Action);
1511 IMPL_XMLOBJECTBUILDER(Advice);
1512 IMPL_XMLOBJECTBUILDER(Assertion);
1513 IMPL_XMLOBJECTBUILDER(AssertionIDRef);
1514 IMPL_XMLOBJECTBUILDER(AssertionURIRef);
1515 IMPL_XMLOBJECTBUILDER(Attribute);
1516 IMPL_XMLOBJECTBUILDER(AttributeStatement);
1517 IMPL_XMLOBJECTBUILDER(AttributeValue);
1518 IMPL_XMLOBJECTBUILDER(Audience);
1519 IMPL_XMLOBJECTBUILDER(AudienceRestriction);
1520 IMPL_XMLOBJECTBUILDER(AuthenticatingAuthority);
1521 IMPL_XMLOBJECTBUILDER(AuthnContext);
1522 IMPL_XMLOBJECTBUILDER(AuthnContextClassRef);
1523 IMPL_XMLOBJECTBUILDER(AuthnContextDecl);
1524 IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef);
1525 IMPL_XMLOBJECTBUILDER(AuthnStatement);
1526 IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement);
1527 IMPL_XMLOBJECTBUILDER(Conditions);
1528 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1529 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1530 IMPL_XMLOBJECTBUILDER(EncryptedID);
1531 IMPL_XMLOBJECTBUILDER(Evidence);
1532 IMPL_XMLOBJECTBUILDER(Issuer);
1533 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1534 IMPL_XMLOBJECTBUILDER(NameID);
1535 IMPL_XMLOBJECTBUILDER(NameIDType);
1536 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1537 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1538 IMPL_XMLOBJECTBUILDER(Subject);
1539 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1540 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1541 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1544 const XMLCh Action::LOCAL_NAME[] = UNICODE_LITERAL_6(A,c,t,i,o,n);
1545 const XMLCh Action::TYPE_NAME[] = UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1546 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1547 const XMLCh Advice::LOCAL_NAME[] = UNICODE_LITERAL_6(A,d,v,i,c,e);
1548 const XMLCh Advice::TYPE_NAME[] = UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1549 const XMLCh Assertion::LOCAL_NAME[] = UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1550 const XMLCh Assertion::TYPE_NAME[] = UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1551 const XMLCh Assertion::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1552 const XMLCh Assertion::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1553 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1554 const XMLCh AssertionIDRef::LOCAL_NAME[] = UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1555 const XMLCh AssertionURIRef::LOCAL_NAME[] = UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1556 const XMLCh Attribute::LOCAL_NAME[] = UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1557 const XMLCh Attribute::TYPE_NAME[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1558 const XMLCh Attribute::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
1559 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1560 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1561 const XMLCh AttributeStatement::LOCAL_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t);
1562 const XMLCh AttributeStatement::TYPE_NAME[] = UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t,T,y,p,e);
1563 const XMLCh AttributeValue::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1564 const XMLCh Audience::LOCAL_NAME[] = UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1565 const XMLCh AudienceRestriction::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n);
1566 const XMLCh AudienceRestriction::TYPE_NAME[] = UNICODE_LITERAL_23(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1567 const XMLCh AuthenticatingAuthority::LOCAL_NAME[] = UNICODE_LITERAL_23(A,u,t,h,e,n,t,i,c,a,t,i,n,g,A,u,t,h,o,r,i,t,y);
1568 const XMLCh AuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1569 const XMLCh AuthnContext::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1570 const XMLCh AuthnContextClassRef::LOCAL_NAME[] = UNICODE_LITERAL_20(A,u,t,h,n,C,o,n,t,e,x,t,C,l,a,s,s,R,e,f);
1571 const XMLCh AuthnContextDecl::LOCAL_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1572 const XMLCh AuthnContextDeclRef::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l,R,e,f);
1573 const XMLCh AuthnStatement::LOCAL_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1574 const XMLCh AuthnStatement::TYPE_NAME[] = UNICODE_LITERAL_18(A,u,t,h,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1575 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1576 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1577 const XMLCh AuthnStatement::SESSIONNOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_19(S,e,s,s,i,o,n,N,o,t,O,n,O,r,A,f,t,e,r);
1578 const XMLCh AuthzDecisionStatement::LOCAL_NAME[] = UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t);
1579 const XMLCh AuthzDecisionStatement::TYPE_NAME[] = UNICODE_LITERAL_26(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1580 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1581 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] = UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1582 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1583 const XMLCh AuthzDecisionStatement::DECISION_DENY[] = UNICODE_LITERAL_4(D,e,n,y);
1584 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] = UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1585 const XMLCh BaseID::LOCAL_NAME[] = UNICODE_LITERAL_6(B,a,s,e,I,D);
1586 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1587 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1588 const XMLCh Condition::LOCAL_NAME[] = UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1589 const XMLCh Conditions::LOCAL_NAME[] = UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1590 const XMLCh Conditions::TYPE_NAME[] = UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1591 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1592 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1593 const XMLCh EncryptedAssertion::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,s,s,e,r,t,i,o,n);
1594 const XMLCh EncryptedAttribute::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,t,t,r,i,b,u,t,e);
1595 const XMLCh EncryptedElementType::LOCAL_NAME[] = {chNull};
1596 const XMLCh EncryptedElementType::TYPE_NAME[] = UNICODE_LITERAL_20(E,n,c,r,y,p,t,e,d,E,l,e,m,e,n,t,T,y,p,e);
1597 const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,d);
1598 const XMLCh Evidence::LOCAL_NAME[] = UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1599 const XMLCh Evidence::TYPE_NAME[] = UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1600 const XMLCh Issuer::LOCAL_NAME[] = UNICODE_LITERAL_6(I,s,s,u,e,r);
1601 const XMLCh KeyInfoConfirmationDataType::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1602 const XMLCh KeyInfoConfirmationDataType::TYPE_NAME[] = UNICODE_LITERAL_27(K,e,y,I,n,f,o,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a,T,y,p,e);
1603 const XMLCh KeyInfoConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1604 const XMLCh KeyInfoConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1605 const XMLCh KeyInfoConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1606 const XMLCh KeyInfoConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1607 const XMLCh KeyInfoConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1608 const XMLCh NameID::LOCAL_NAME[] = UNICODE_LITERAL_6(N,a,m,e,I,D);
1609 const XMLCh NameIDType::LOCAL_NAME[] = {chNull};
1610 const XMLCh NameIDType::TYPE_NAME[] = UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1611 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1612 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1613 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
1614 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1615 const XMLCh OneTimeUse::LOCAL_NAME[] = UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1616 const XMLCh OneTimeUse::TYPE_NAME[] = UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1617 const XMLCh ProxyRestriction::LOCAL_NAME[] = UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1618 const XMLCh ProxyRestriction::TYPE_NAME[] = UNICODE_LITERAL_20(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1619 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1620 const XMLCh Statement::LOCAL_NAME[] = UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1621 const XMLCh Subject::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1622 const XMLCh Subject::TYPE_NAME[] = UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1623 const XMLCh SubjectConfirmation::LOCAL_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n);
1624 const XMLCh SubjectConfirmation::TYPE_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,T,y,p,e);
1625 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1626 const XMLCh SubjectConfirmationData::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1627 const XMLCh SubjectConfirmationData::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1628 const XMLCh SubjectConfirmationData::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1629 const XMLCh SubjectConfirmationData::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1630 const XMLCh SubjectConfirmationData::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1631 const XMLCh SubjectConfirmationData::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1632 const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1633 const XMLCh SubjectLocality::TYPE_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y,T,y,p,e);
1634 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1635 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1637 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1638 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1639 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1640 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1641 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1642 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1643 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1646 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1647 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1648 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1649 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1650 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1651 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1652 chLatin_e, chLatin_m, chLatin_a, chLatin_i, chLatin_l, chLatin_A, chLatin_d, chLatin_d, chLatin_r, chLatin_e, chLatin_s, chLatin_s, chNull
1655 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1656 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1657 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1658 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1659 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1660 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1661 chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1662 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1665 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1666 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1667 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1668 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1669 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1670 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1671 chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1672 chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1673 chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1674 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1677 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1678 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1679 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1680 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1681 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1682 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1683 chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1686 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1687 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1688 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1689 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1690 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1691 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1692 chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1695 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1696 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1697 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1698 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1699 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1700 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1701 chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1704 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1705 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1706 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1707 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1708 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1709 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1710 chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1713 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1714 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1715 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1716 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1717 chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1720 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1721 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1722 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1723 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1724 chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1725 chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1728 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1729 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1730 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1731 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1732 chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1733 chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1736 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1737 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1738 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1739 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1740 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1741 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1744 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1745 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1746 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1747 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1748 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1749 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1750 chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1753 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1754 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1755 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1756 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1757 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1758 chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1761 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1762 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1763 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1764 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1765 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1766 chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1769 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1770 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1771 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1772 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1773 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1774 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1775 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1778 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1779 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1780 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1781 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1782 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1783 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1784 chLatin_u, chLatin_r, chLatin_i, chNull
1787 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1788 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1789 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1790 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1791 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1792 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1793 chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull