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;
47 #if defined (_MSC_VER)
48 #pragma warning( push )
49 #pragma warning( disable : 4250 4251 )
55 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
56 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
57 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextClassRef);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextDeclRef);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthenticatingAuthority);
62 class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType,
63 public AbstractSimpleElement,
64 public AbstractDOMCachingXMLObject,
65 public AbstractXMLObjectMarshaller,
66 public AbstractXMLObjectUnmarshaller
69 m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL;
78 virtual ~NameIDTypeImpl() {
79 XMLString::release(&m_NameQualifier);
80 XMLString::release(&m_SPNameQualifier);
81 XMLString::release(&m_Format);
82 XMLString::release(&m_SPProvidedID);
85 NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
86 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
90 NameIDTypeImpl(const NameIDTypeImpl& src)
91 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
93 setNameQualifier(src.getNameQualifier());
94 setSPNameQualifier(src.getSPNameQualifier());
95 setFormat(src.getFormat());
96 setSPProvidedID(src.getSPProvidedID());
99 IMPL_XMLOBJECT_CLONE(NameIDType);
100 IMPL_STRING_ATTRIB(NameQualifier);
101 IMPL_STRING_ATTRIB(SPNameQualifier);
102 IMPL_STRING_ATTRIB(Format);
103 IMPL_STRING_ATTRIB(SPProvidedID);
106 void marshallAttributes(DOMElement* domElement) const {
107 MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
108 MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
109 MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
110 MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
113 void processAttribute(const DOMAttr* attribute) {
114 PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
115 PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
116 PROC_STRING_ATTRIB(Format,FORMAT,NULL);
117 PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
118 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
122 class SAML_DLLLOCAL NameIDImpl : public virtual NameID, public NameIDTypeImpl
125 virtual ~NameIDImpl() {}
127 NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
128 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
130 NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
132 IMPL_XMLOBJECT_CLONE(NameID);
133 NameIDType* cloneNameIDType() const {
134 return new NameIDImpl(*this);
138 class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl
141 virtual ~IssuerImpl() {}
143 IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
144 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
146 IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
148 IMPL_XMLOBJECT_CLONE(Issuer);
149 NameIDType* cloneNameIDType() const {
150 return new IssuerImpl(*this);
154 //TODO unit test for this
155 // - need to test encryption/decryption too, or already done in xmltooling ?
156 class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType,
157 public AbstractComplexElement,
158 public AbstractDOMCachingXMLObject,
159 public AbstractXMLObjectMarshaller,
160 public AbstractXMLObjectUnmarshaller
163 m_EncryptedData=NULL;
164 m_children.push_back(NULL);
165 m_pos_EncryptedData=m_children.begin();
169 EncryptedElementTypeImpl() {
174 virtual ~EncryptedElementTypeImpl() {}
176 EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
177 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
181 EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src)
182 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
184 if (src.getEncryptedData())
185 setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
186 VectorOf(EncryptedKey) v=getEncryptedKeys();
187 for (vector<EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
189 v.push_back((*i)->cloneEncryptedKey());
194 XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
196 if (!m_EncryptedData)
197 throw DecryptionException("No encrypted data present.");
198 Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
199 DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
200 if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
201 DOMNode* plaintext=frag->getFirstChild();
202 if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
203 auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
204 ret->releaseThisAndChildrenDOM();
205 return ret.release();
209 throw DecryptionException("Decryption did not result in a single element.");
212 IMPL_XMLOBJECT_CLONE(EncryptedElementType);
213 IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
214 IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
217 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
218 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false);
219 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false);
220 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
224 //TODO unit test for this
225 class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
228 virtual ~EncryptedIDImpl() {}
230 EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
231 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
233 EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
235 IMPL_XMLOBJECT_CLONE(EncryptedID);
236 EncryptedElementType* cloneEncryptedElementType() const {
237 return new EncryptedIDImpl(*this);
241 class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction,
242 public AbstractComplexElement,
243 public AbstractDOMCachingXMLObject,
244 public AbstractXMLObjectMarshaller,
245 public AbstractXMLObjectUnmarshaller
248 virtual ~AudienceRestrictionImpl() {}
250 AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
251 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
254 AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
255 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
256 VectorOf(Audience) v=getAudiences();
257 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
259 v.push_back((*i)->cloneAudience());
264 IMPL_XMLOBJECT_CLONE(AudienceRestriction);
265 Condition* cloneCondition() const {
266 return cloneAudienceRestriction();
268 IMPL_TYPED_CHILDREN(Audience,m_children.end());
271 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
272 PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false);
273 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
277 class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
278 public AbstractSimpleElement,
279 public AbstractDOMCachingXMLObject,
280 public AbstractXMLObjectMarshaller,
281 public AbstractXMLObjectUnmarshaller
284 virtual ~OneTimeUseImpl() {}
286 OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
287 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
290 OneTimeUseImpl(const OneTimeUseImpl& src)
291 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
294 IMPL_XMLOBJECT_CLONE(OneTimeUse);
295 Condition* cloneCondition() const {
296 return cloneOneTimeUse();
300 class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
301 public AbstractComplexElement,
302 public AbstractDOMCachingXMLObject,
303 public AbstractXMLObjectMarshaller,
304 public AbstractXMLObjectUnmarshaller
307 virtual ~ProxyRestrictionImpl() {
308 XMLString::release(&m_Count);
311 ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
312 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
316 ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
317 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
318 setCount(src.m_Count);
319 VectorOf(Audience) v=getAudiences();
320 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
322 v.push_back((*i)->cloneAudience());
327 IMPL_XMLOBJECT_CLONE(ProxyRestriction);
328 Condition* cloneCondition() const {
329 return cloneProxyRestriction();
331 IMPL_TYPED_CHILDREN(Audience,m_children.end());
332 IMPL_INTEGER_ATTRIB(Count);
335 void marshallAttributes(DOMElement* domElement) const {
336 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
339 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
340 PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false);
341 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
344 void processAttribute(const DOMAttr* attribute) {
345 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
346 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
351 class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
352 public AbstractComplexElement,
353 public AbstractDOMCachingXMLObject,
354 public AbstractXMLObjectMarshaller,
355 public AbstractXMLObjectUnmarshaller
358 m_NotBefore=m_NotOnOrAfter=NULL;
361 virtual ~ConditionsImpl() {
363 delete m_NotOnOrAfter;
366 ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
367 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
371 ConditionsImpl(const ConditionsImpl& src)
372 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
374 setNotBefore(src.getNotBefore());
375 setNotOnOrAfter(src.getNotOnOrAfter());
377 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
379 AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
381 getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
385 OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
387 getOneTimeUses().push_back(dncc->cloneOneTimeUse());
391 ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
393 getProxyRestrictions().push_back(prc->cloneProxyRestriction());
397 Condition* c=dynamic_cast<Condition*>(*i);
399 getConditions().push_back(c->cloneCondition());
406 IMPL_XMLOBJECT_CLONE(Conditions);
407 IMPL_DATETIME_ATTRIB(NotBefore,0);
408 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
409 IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
410 IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
411 IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
412 IMPL_TYPED_CHILDREN(Condition,m_children.end());
415 void marshallAttributes(DOMElement* domElement) const {
416 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
417 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
420 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
421 PROC_TYPED_CHILDREN(AudienceRestriction,SAMLConstants::SAML20_NS,false);
422 PROC_TYPED_CHILDREN(OneTimeUse,SAMLConstants::SAML20_NS,false);
423 PROC_TYPED_CHILDREN(ProxyRestriction,SAMLConstants::SAML20_NS,false);
424 PROC_TYPED_CHILDREN(Condition,SAMLConstants::SAML20_NS,false);
425 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
428 void processAttribute(const DOMAttr* attribute) {
429 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
430 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
431 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
435 class SAML_DLLLOCAL SubjectConfirmationDataImpl : public virtual SubjectConfirmationData, public AnyElementImpl
438 m_NotBefore=m_NotOnOrAfter=NULL;
439 m_Recipient=m_InResponseTo=m_Address=NULL;
442 virtual ~SubjectConfirmationDataImpl() {
444 delete m_NotOnOrAfter;
445 XMLString::release(&m_Recipient);
446 XMLString::release(&m_InResponseTo);
447 XMLString::release(&m_Address);
450 SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
451 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
455 SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src) : AnyElementImpl(src) {
457 setNotBefore(src.getNotBefore());
458 setNotOnOrAfter(src.getNotOnOrAfter());
459 setRecipient(src.getRecipient());
460 setInResponseTo(src.getInResponseTo());
461 setAddress(src.getAddress());
464 IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
465 IMPL_DATETIME_ATTRIB(NotBefore,0);
466 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
467 IMPL_STRING_ATTRIB(Recipient);
468 IMPL_STRING_ATTRIB(InResponseTo);
469 IMPL_STRING_ATTRIB(Address);
472 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
473 if (!qualifiedName.hasNamespaceURI()) {
474 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
478 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
479 setNotOnOrAfter(value);
482 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
486 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
487 setInResponseTo(value);
490 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
495 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
499 void marshallAttributes(DOMElement* domElement) const {
500 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
501 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
502 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
503 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
504 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
505 AnyElementImpl::marshallAttributes(domElement);
508 // The processAttributes hook is handled by AnyElementImpl
511 class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
512 public AbstractComplexElement,
513 public AbstractAttributeExtensibleXMLObject,
514 public AbstractDOMCachingXMLObject,
515 public AbstractXMLObjectMarshaller,
516 public AbstractXMLObjectUnmarshaller
519 m_NotBefore=m_NotOnOrAfter=NULL;
520 m_Recipient=m_InResponseTo=m_Address=NULL;
523 virtual ~KeyInfoConfirmationDataTypeImpl() {
525 delete m_NotOnOrAfter;
526 XMLString::release(&m_Recipient);
527 XMLString::release(&m_InResponseTo);
528 XMLString::release(&m_Address);
531 KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
532 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
536 KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
537 : AbstractXMLObject(src), AbstractComplexElement(src),
538 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
540 setNotBefore(src.getNotBefore());
541 setNotOnOrAfter(src.getNotOnOrAfter());
542 setRecipient(src.getRecipient());
543 setInResponseTo(src.getInResponseTo());
544 setAddress(src.getAddress());
545 VectorOf(KeyInfo) v=getKeyInfos();
546 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); i++) {
548 v.push_back((*i)->cloneKeyInfo());
553 IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
554 IMPL_DATETIME_ATTRIB(NotBefore,0);
555 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
556 IMPL_STRING_ATTRIB(Recipient);
557 IMPL_STRING_ATTRIB(InResponseTo);
558 IMPL_STRING_ATTRIB(Address);
559 IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
562 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
563 if (!qualifiedName.hasNamespaceURI()) {
564 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
568 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
569 setNotOnOrAfter(value);
572 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
576 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
577 setInResponseTo(value);
580 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
585 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
589 void marshallAttributes(DOMElement* domElement) const {
590 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
591 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
592 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
593 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
594 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
595 marshallExtensionAttributes(domElement);
598 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
599 PROC_TYPED_CHILDREN(KeyInfo,XMLConstants::XMLSIG_NS,false);
600 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
603 void processAttribute(const DOMAttr* attribute) {
604 unmarshallExtensionAttribute(attribute);
608 class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
609 public AbstractComplexElement,
610 public AbstractDOMCachingXMLObject,
611 public AbstractXMLObjectMarshaller,
612 public AbstractXMLObjectUnmarshaller
619 m_SubjectConfirmationData=NULL;
620 m_KeyInfoConfirmationDataType=NULL;
621 m_children.push_back(NULL);
622 m_children.push_back(NULL);
623 m_children.push_back(NULL);
624 m_children.push_back(NULL);
625 m_pos_BaseID=m_children.begin();
626 m_pos_NameID=m_pos_BaseID;
628 m_pos_EncryptedID=m_pos_NameID;
630 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
631 ++m_pos_SubjectConfirmationData;
632 m_pos_KeyInfoConfirmationDataType=m_pos_SubjectConfirmationData;
633 ++m_pos_KeyInfoConfirmationDataType;
636 virtual ~SubjectConfirmationImpl() {}
638 SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
639 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
643 SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
644 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
646 setMethod(src.getMethod());
648 setBaseID(src.getBaseID()->cloneBaseID());
650 setNameID(src.getNameID()->cloneNameID());
651 if (src.getEncryptedID())
652 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
653 if (src.getSubjectConfirmationData())
654 setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
655 if (src.getKeyInfoConfirmationDataType())
656 setKeyInfoConfirmationDataType(src.getKeyInfoConfirmationDataType()->cloneKeyInfoConfirmationDataType());
659 IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
660 IMPL_STRING_ATTRIB(Method);
661 IMPL_TYPED_CHILD(BaseID);
662 IMPL_TYPED_CHILD(NameID);
663 IMPL_TYPED_CHILD(EncryptedID);
664 IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
665 IMPL_TYPED_CHILD(KeyInfoConfirmationDataType);
668 void marshallAttributes(DOMElement* domElement) const {
669 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
672 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
673 PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false);
674 PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false);
675 PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false);
676 PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAMLConstants::SAML20_NS,false);
677 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAMLConstants::SAML20_NS);
678 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
681 void processAttribute(const DOMAttr* attribute) {
682 PROC_STRING_ATTRIB(Method,METHOD,NULL);
683 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
687 class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
688 public AbstractComplexElement,
689 public AbstractDOMCachingXMLObject,
690 public AbstractXMLObjectMarshaller,
691 public AbstractXMLObjectUnmarshaller
697 m_children.push_back(NULL);
698 m_children.push_back(NULL);
699 m_children.push_back(NULL);
700 m_pos_BaseID=m_children.begin();
701 m_pos_NameID=m_pos_BaseID;
703 m_pos_EncryptedID=m_pos_NameID;
707 virtual ~SubjectImpl() {}
709 SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
710 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
714 SubjectImpl(const SubjectImpl& src)
715 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
718 setBaseID(src.getBaseID()->cloneBaseID());
720 setNameID(src.getNameID()->cloneNameID());
721 if (src.getEncryptedID())
722 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
723 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
724 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
726 v.push_back((*i)->cloneSubjectConfirmation());
731 IMPL_XMLOBJECT_CLONE(Subject);
732 IMPL_TYPED_CHILD(NameID);
733 IMPL_TYPED_CHILD(BaseID);
734 IMPL_TYPED_CHILD(EncryptedID);
735 IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
738 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
739 PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false);
740 PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false);
741 PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false);
742 PROC_TYPED_CHILDREN(SubjectConfirmation,SAMLConstants::SAML20_NS,false);
743 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
747 class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
748 public AbstractSimpleElement,
749 public AbstractDOMCachingXMLObject,
750 public AbstractXMLObjectMarshaller,
751 public AbstractXMLObjectUnmarshaller
754 m_Address=m_DNSName=NULL;
757 virtual ~SubjectLocalityImpl() {
758 XMLString::release(&m_Address);
759 XMLString::release(&m_DNSName);
762 SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
763 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
767 SubjectLocalityImpl(const SubjectLocalityImpl& src)
768 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
770 setAddress(src.getAddress());
771 setDNSName(src.getDNSName());
774 IMPL_XMLOBJECT_CLONE(SubjectLocality);
775 IMPL_STRING_ATTRIB(Address);
776 IMPL_STRING_ATTRIB(DNSName);
779 void marshallAttributes(DOMElement* domElement) const {
780 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
781 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
784 void processAttribute(const DOMAttr* attribute) {
785 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
786 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
787 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
791 //TODO need unit test for this
792 class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
795 virtual ~AuthnContextDeclImpl() {}
797 AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
798 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
801 AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
804 IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
807 class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
808 public AbstractComplexElement,
809 public AbstractDOMCachingXMLObject,
810 public AbstractXMLObjectMarshaller,
811 public AbstractXMLObjectUnmarshaller
814 m_AuthnContextClassRef=NULL;
815 m_AuthnContextDecl=NULL;
816 m_AuthnContextDeclRef=NULL;
817 m_children.push_back(NULL);
818 m_children.push_back(NULL);
819 m_children.push_back(NULL);
820 m_pos_AuthnContextClassRef=m_children.begin();
821 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
822 ++m_pos_AuthnContextDecl;
823 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
824 ++m_pos_AuthnContextDeclRef;
827 virtual ~AuthnContextImpl() {}
829 AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
830 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
834 AuthnContextImpl(const AuthnContextImpl& src)
835 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
837 if (src.getAuthnContextClassRef())
838 setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
839 if (src.getAuthnContextDecl())
840 setAuthnContextDecl(src.getAuthnContextDecl()->clone());
841 if (src.getAuthnContextDeclRef())
842 setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
843 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
844 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
846 v.push_back((*i)->cloneAuthenticatingAuthority());
851 IMPL_XMLOBJECT_CLONE(AuthnContext);
852 IMPL_TYPED_CHILD(AuthnContextClassRef);
853 IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
854 IMPL_TYPED_CHILD(AuthnContextDeclRef);
855 IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
858 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
859 PROC_TYPED_CHILD(AuthnContextClassRef,SAMLConstants::SAML20_NS,false);
860 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAMLConstants::SAML20_NS);
861 PROC_TYPED_CHILD(AuthnContextDeclRef,SAMLConstants::SAML20_NS,false);
862 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAMLConstants::SAML20_NS,false);
863 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
867 class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
868 public AbstractComplexElement,
869 public AbstractDOMCachingXMLObject,
870 public AbstractXMLObjectMarshaller,
871 public AbstractXMLObjectUnmarshaller
876 m_SessionNotOnOrAfter=NULL;
877 m_SubjectLocality=NULL;
879 m_children.push_back(NULL);
880 m_children.push_back(NULL);
881 m_pos_SubjectLocality=m_children.begin();
882 m_pos_AuthnContext=m_pos_SubjectLocality;
883 ++m_pos_AuthnContext;
886 virtual ~AuthnStatementImpl() {
887 delete m_AuthnInstant;
888 XMLString::release(&m_SessionIndex);
889 delete m_SessionNotOnOrAfter;
892 AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
893 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
897 AuthnStatementImpl(const AuthnStatementImpl& src)
898 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
900 setAuthnInstant(src.getAuthnInstant());
901 setSessionIndex(src.getSessionIndex());
902 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
903 if (src.getSubjectLocality())
904 setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
905 if (src.getAuthnContext())
906 setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
909 IMPL_XMLOBJECT_CLONE(AuthnStatement);
910 Statement* cloneStatement() const {
911 return cloneAuthnStatement();
913 IMPL_DATETIME_ATTRIB(AuthnInstant,0);
914 IMPL_STRING_ATTRIB(SessionIndex);
915 IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
916 IMPL_TYPED_CHILD(SubjectLocality);
917 IMPL_TYPED_CHILD(AuthnContext);
920 void marshallAttributes(DOMElement* domElement) const {
921 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
922 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
923 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
926 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
927 PROC_TYPED_CHILD(SubjectLocality,SAMLConstants::SAML20_NS,false);
928 PROC_TYPED_CHILD(AuthnContext,SAMLConstants::SAML20_NS,false);
929 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
932 void processAttribute(const DOMAttr* attribute) {
933 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
934 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
935 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
936 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
940 class SAML_DLLLOCAL ActionImpl : public virtual Action,
941 public AbstractSimpleElement,
942 public AbstractDOMCachingXMLObject,
943 public AbstractXMLObjectMarshaller,
944 public AbstractXMLObjectUnmarshaller
947 virtual ~ActionImpl() {
948 XMLString::release(&m_Namespace);
951 ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
952 : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
955 ActionImpl(const ActionImpl& src)
956 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
957 setNamespace(src.getNamespace());
960 IMPL_XMLOBJECT_CLONE(Action);
961 IMPL_STRING_ATTRIB(Namespace);
964 void marshallAttributes(DOMElement* domElement) const {
965 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
968 void processAttribute(const DOMAttr* attribute) {
969 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
970 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
974 class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
975 public AbstractComplexElement,
976 public AbstractDOMCachingXMLObject,
977 public AbstractXMLObjectMarshaller,
978 public AbstractXMLObjectUnmarshaller
981 virtual ~EvidenceImpl() {}
983 EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
984 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
987 EvidenceImpl(const EvidenceImpl& src)
988 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
989 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
991 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
993 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
997 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
999 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1003 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1005 getAssertions().push_back(assertion->cloneAssertion());
1009 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1011 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1018 IMPL_XMLOBJECT_CLONE(Evidence);
1019 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1020 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1021 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1022 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1025 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1026 PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false);
1027 PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false);
1028 PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false);
1029 PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false);
1030 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1034 class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1035 public AbstractComplexElement,
1036 public AbstractDOMCachingXMLObject,
1037 public AbstractXMLObjectMarshaller,
1038 public AbstractXMLObjectUnmarshaller
1044 m_children.push_back(NULL);
1045 m_pos_Evidence=m_children.begin();
1048 virtual ~AuthzDecisionStatementImpl() {
1049 XMLString::release(&m_Resource);
1050 XMLString::release(&m_Decision);
1053 AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1054 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1058 AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1059 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1061 setResource(src.getResource());
1062 setDecision(src.getDecision());
1063 if (src.getEvidence())
1064 setEvidence(src.getEvidence()->cloneEvidence());
1065 VectorOf(Action) v=getActions();
1066 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1068 v.push_back((*i)->cloneAction());
1073 IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1074 Statement* cloneStatement() const {
1075 return cloneAuthzDecisionStatement();
1077 IMPL_STRING_ATTRIB(Resource);
1078 IMPL_STRING_ATTRIB(Decision);
1079 IMPL_TYPED_CHILD(Evidence);
1080 IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1083 void marshallAttributes(DOMElement* domElement) const {
1084 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1085 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1088 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1089 PROC_TYPED_CHILD(Evidence,SAMLConstants::SAML20_NS,false);
1090 PROC_TYPED_CHILDREN(Action,SAMLConstants::SAML20_NS,false);
1091 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1094 void processAttribute(const DOMAttr* attribute) {
1095 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1096 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1097 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1101 //TODO need unit test for this
1102 class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1105 virtual ~AttributeValueImpl() {}
1107 AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1108 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1111 AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1114 IMPL_XMLOBJECT_CLONE(AttributeValue);
1118 class SAML_DLLLOCAL AttributeImpl : public virtual Attribute,
1119 public AbstractComplexElement,
1120 public AbstractAttributeExtensibleXMLObject,
1121 public AbstractDOMCachingXMLObject,
1122 public AbstractXMLObjectMarshaller,
1123 public AbstractXMLObjectUnmarshaller
1126 m_Name=m_NameFormat=m_FriendlyName=NULL;
1129 virtual ~AttributeImpl() {
1130 XMLString::release(&m_Name);
1131 XMLString::release(&m_NameFormat);
1132 XMLString::release(&m_FriendlyName);
1135 AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1136 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1140 AttributeImpl(const AttributeImpl& src)
1141 : AbstractXMLObject(src), AbstractComplexElement(src),
1142 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1144 setName(src.getName());
1145 setNameFormat(src.getNameFormat());
1146 setFriendlyName(src.getFriendlyName());
1147 VectorOf(XMLObject) v=getAttributeValues();
1148 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1150 v.push_back((*i)->clone());
1155 IMPL_XMLOBJECT_CLONE(Attribute);
1156 IMPL_STRING_ATTRIB(Name);
1157 IMPL_STRING_ATTRIB(NameFormat);
1158 IMPL_STRING_ATTRIB(FriendlyName);
1159 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1161 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
1162 if (!qualifiedName.hasNamespaceURI()) {
1163 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1167 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1168 setNameFormat(value);
1171 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1172 setFriendlyName(value);
1176 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1180 void marshallAttributes(DOMElement* domElement) const {
1181 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1182 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1183 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1184 marshallExtensionAttributes(domElement);
1187 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1188 getAttributeValues().push_back(childXMLObject);
1191 void processAttribute(const DOMAttr* attribute) {
1192 unmarshallExtensionAttribute(attribute);
1196 //TODO unit test for this
1197 class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl
1200 virtual ~EncryptedAttributeImpl() {}
1202 EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1203 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1205 EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1207 IMPL_XMLOBJECT_CLONE(EncryptedAttribute);
1208 EncryptedElementType* cloneEncryptedElementType() const {
1209 return new EncryptedAttributeImpl(*this);
1213 class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement,
1214 public AbstractComplexElement,
1215 public AbstractDOMCachingXMLObject,
1216 public AbstractXMLObjectMarshaller,
1217 public AbstractXMLObjectUnmarshaller
1220 virtual ~AttributeStatementImpl() {}
1222 AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1223 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1226 AttributeStatementImpl(const AttributeStatementImpl& src)
1227 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1228 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1230 Attribute* attribute=dynamic_cast<Attribute*>(*i);
1232 getAttributes().push_back(attribute->cloneAttribute());
1236 EncryptedAttribute* enc=dynamic_cast<EncryptedAttribute*>(*i);
1238 getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute());
1245 IMPL_XMLOBJECT_CLONE(AttributeStatement);
1246 Statement* cloneStatement() const {
1247 return cloneAttributeStatement();
1249 IMPL_TYPED_CHILDREN(Attribute, m_children.end());
1250 IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end());
1253 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1254 PROC_TYPED_CHILDREN(Attribute,SAMLConstants::SAML20_NS,false);
1255 PROC_TYPED_CHILDREN(EncryptedAttribute,SAMLConstants::SAML20_NS,false);
1256 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1260 class SAML_DLLLOCAL AdviceImpl : public virtual Advice,
1261 public AbstractComplexElement,
1262 public AbstractDOMCachingXMLObject,
1263 public AbstractXMLObjectMarshaller,
1264 public AbstractXMLObjectUnmarshaller
1267 virtual ~AdviceImpl() {}
1269 AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1270 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1273 AdviceImpl(const AdviceImpl& src)
1274 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1275 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1277 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1279 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1283 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1285 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1289 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1291 getAssertions().push_back(assertion->cloneAssertion());
1295 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1297 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1301 getOthers().push_back((*i)->clone());
1306 IMPL_XMLOBJECT_CLONE(Advice);
1307 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1308 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1309 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1310 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1311 IMPL_XMLOBJECT_CHILDREN(Other,m_children.end());
1314 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1315 PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false);
1316 PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false);
1317 PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false);
1318 PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false);
1321 const XMLCh* nsURI=root->getNamespaceURI();
1322 if (!XMLString::equals(nsURI,SAMLConstants::SAML20_NS) && nsURI && *nsURI) {
1323 getOthers().push_back(childXMLObject);
1327 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1331 //TODO unit test for this
1332 class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl
1335 virtual ~EncryptedAssertionImpl() {}
1337 EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1338 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1340 EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1342 IMPL_XMLOBJECT_CLONE(EncryptedAssertion);
1343 EncryptedElementType* cloneEncryptedElementType() const {
1344 return new EncryptedAssertionImpl(*this);
1348 class SAML_DLLLOCAL AssertionImpl : public virtual Assertion,
1349 public AbstractComplexElement,
1350 public AbstractDOMCachingXMLObject,
1351 public AbstractXMLObjectMarshaller,
1352 public AbstractXMLObjectUnmarshaller
1357 m_IssueInstant=NULL;
1363 m_children.push_back(NULL);
1364 m_children.push_back(NULL);
1365 m_children.push_back(NULL);
1366 m_children.push_back(NULL);
1367 m_children.push_back(NULL);
1368 m_pos_Issuer=m_children.begin();
1369 m_pos_Signature=m_pos_Issuer;
1371 m_pos_Subject=m_pos_Signature;
1373 m_pos_Conditions=m_pos_Subject;
1375 m_pos_Advice=m_pos_Conditions;
1379 virtual ~AssertionImpl() {
1380 XMLString::release(&m_ID);
1381 XMLString::release(&m_Version);
1382 delete m_IssueInstant;
1385 AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1386 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1390 AssertionImpl(const AssertionImpl& src)
1391 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1393 setVersion(src.getVersion());
1395 setIssueInstant(src.getIssueInstant());
1396 if (src.getIssuer())
1397 setIssuer(src.getIssuer()->cloneIssuer());
1398 if (src.getSignature())
1399 setSignature(src.getSignature()->cloneSignature());
1400 if (src.getSubject())
1401 setSubject(src.getSubject()->cloneSubject());
1402 if (src.getConditions())
1403 setConditions(src.getConditions()->cloneConditions());
1404 if (src.getAdvice())
1405 setAdvice(src.getAdvice()->cloneAdvice());
1406 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1408 AuthnStatement* authst=dynamic_cast<AuthnStatement*>(*i);
1410 getAuthnStatements().push_back(authst->cloneAuthnStatement());
1414 AttributeStatement* attst=dynamic_cast<AttributeStatement*>(*i);
1416 getAttributeStatements().push_back(attst->cloneAttributeStatement());
1420 AuthzDecisionStatement* authzst=dynamic_cast<AuthzDecisionStatement*>(*i);
1422 getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement());
1426 Statement* st=dynamic_cast<Statement*>(*i);
1428 getStatements().push_back(st->cloneStatement());
1435 //IMPL_TYPED_CHILD(Signature);
1436 // Need customized setter.
1438 Signature* m_Signature;
1439 list<XMLObject*>::iterator m_pos_Signature;
1441 Signature* getSignature() const {
1445 void setSignature(Signature* sig) {
1446 prepareForAssignment(m_Signature,sig);
1447 *m_pos_Signature=m_Signature=sig;
1448 // Sync content reference back up.
1450 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1453 IMPL_XMLOBJECT_CLONE(Assertion);
1454 IMPL_STRING_ATTRIB(Version);
1456 IMPL_DATETIME_ATTRIB(IssueInstant,0);
1457 IMPL_TYPED_CHILD(Issuer);
1458 IMPL_TYPED_CHILD(Subject);
1459 IMPL_TYPED_CHILD(Conditions);
1460 IMPL_TYPED_CHILD(Advice);
1461 IMPL_TYPED_CHILDREN(Statement, m_children.end());
1462 IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end());
1463 IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end());
1464 IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end());
1467 void marshallAttributes(DOMElement* domElement) const {
1469 const_cast<AssertionImpl*>(this)->m_Version=XMLString::transcode("2.0");
1470 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1472 const_cast<AssertionImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1473 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1474 if (!m_IssueInstant) {
1475 const_cast<AssertionImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1476 const_cast<AssertionImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1478 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1481 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1482 PROC_TYPED_CHILD(Issuer,SAMLConstants::SAML20_NS,false);
1483 PROC_TYPED_CHILD(Signature,XMLConstants::XMLSIG_NS,false);
1484 PROC_TYPED_CHILD(Subject,SAMLConstants::SAML20_NS,false);
1485 PROC_TYPED_CHILD(Conditions,SAMLConstants::SAML20_NS,false);
1486 PROC_TYPED_CHILD(Advice,SAMLConstants::SAML20_NS,false);
1487 PROC_TYPED_CHILDREN(AuthnStatement,SAMLConstants::SAML20_NS,false);
1488 PROC_TYPED_CHILDREN(AttributeStatement,SAMLConstants::SAML20_NS,false);
1489 PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAMLConstants::SAML20_NS,false);
1490 PROC_TYPED_CHILDREN(Statement,SAMLConstants::SAML20_NS,false);
1491 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1494 void processAttribute(const DOMAttr* attribute) {
1495 PROC_STRING_ATTRIB(Version,VER,NULL);
1496 PROC_ID_ATTRIB(ID,ID,NULL);
1497 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1498 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1505 #if defined (_MSC_VER)
1506 #pragma warning( pop )
1509 // Builder Implementations
1511 IMPL_XMLOBJECTBUILDER(Action);
1512 IMPL_XMLOBJECTBUILDER(Advice);
1513 IMPL_XMLOBJECTBUILDER(Assertion);
1514 IMPL_XMLOBJECTBUILDER(AssertionIDRef);
1515 IMPL_XMLOBJECTBUILDER(AssertionURIRef);
1516 IMPL_XMLOBJECTBUILDER(Attribute);
1517 IMPL_XMLOBJECTBUILDER(AttributeStatement);
1518 IMPL_XMLOBJECTBUILDER(AttributeValue);
1519 IMPL_XMLOBJECTBUILDER(Audience);
1520 IMPL_XMLOBJECTBUILDER(AudienceRestriction);
1521 IMPL_XMLOBJECTBUILDER(AuthenticatingAuthority);
1522 IMPL_XMLOBJECTBUILDER(AuthnContext);
1523 IMPL_XMLOBJECTBUILDER(AuthnContextClassRef);
1524 IMPL_XMLOBJECTBUILDER(AuthnContextDecl);
1525 IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef);
1526 IMPL_XMLOBJECTBUILDER(AuthnStatement);
1527 IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement);
1528 IMPL_XMLOBJECTBUILDER(Conditions);
1529 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1530 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1531 IMPL_XMLOBJECTBUILDER(EncryptedID);
1532 IMPL_XMLOBJECTBUILDER(Evidence);
1533 IMPL_XMLOBJECTBUILDER(Issuer);
1534 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1535 IMPL_XMLOBJECTBUILDER(NameID);
1536 IMPL_XMLOBJECTBUILDER(NameIDType);
1537 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1538 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1539 IMPL_XMLOBJECTBUILDER(Subject);
1540 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1541 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1542 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1545 const XMLCh Action::LOCAL_NAME[] = UNICODE_LITERAL_6(A,c,t,i,o,n);
1546 const XMLCh Action::TYPE_NAME[] = UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1547 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1548 const XMLCh Advice::LOCAL_NAME[] = UNICODE_LITERAL_6(A,d,v,i,c,e);
1549 const XMLCh Advice::TYPE_NAME[] = UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1550 const XMLCh Assertion::LOCAL_NAME[] = UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1551 const XMLCh Assertion::TYPE_NAME[] = UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1552 const XMLCh Assertion::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1553 const XMLCh Assertion::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1554 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1555 const XMLCh AssertionIDRef::LOCAL_NAME[] = UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1556 const XMLCh AssertionURIRef::LOCAL_NAME[] = UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1557 const XMLCh Attribute::LOCAL_NAME[] = UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1558 const XMLCh Attribute::TYPE_NAME[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1559 const XMLCh Attribute::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
1560 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1561 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1562 const XMLCh AttributeStatement::LOCAL_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t);
1563 const XMLCh AttributeStatement::TYPE_NAME[] = UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t,T,y,p,e);
1564 const XMLCh AttributeValue::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1565 const XMLCh Audience::LOCAL_NAME[] = UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1566 const XMLCh AudienceRestriction::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n);
1567 const XMLCh AudienceRestriction::TYPE_NAME[] = UNICODE_LITERAL_23(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1568 const XMLCh AuthenticatingAuthority::LOCAL_NAME[] = UNICODE_LITERAL_23(A,u,t,h,e,n,t,i,c,a,t,i,n,g,A,u,t,h,o,r,i,t,y);
1569 const XMLCh AuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1570 const XMLCh AuthnContext::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1571 const XMLCh AuthnContextClassRef::LOCAL_NAME[] = UNICODE_LITERAL_20(A,u,t,h,n,C,o,n,t,e,x,t,C,l,a,s,s,R,e,f);
1572 const XMLCh AuthnContextDecl::LOCAL_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1573 const XMLCh AuthnContextDeclRef::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l,R,e,f);
1574 const XMLCh AuthnStatement::LOCAL_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1575 const XMLCh AuthnStatement::TYPE_NAME[] = UNICODE_LITERAL_18(A,u,t,h,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1576 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1577 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1578 const XMLCh AuthnStatement::SESSIONNOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_19(S,e,s,s,i,o,n,N,o,t,O,n,O,r,A,f,t,e,r);
1579 const XMLCh AuthzDecisionStatement::LOCAL_NAME[] = UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t);
1580 const XMLCh AuthzDecisionStatement::TYPE_NAME[] = UNICODE_LITERAL_26(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1581 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1582 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] = UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1583 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1584 const XMLCh AuthzDecisionStatement::DECISION_DENY[] = UNICODE_LITERAL_4(D,e,n,y);
1585 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] = UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1586 const XMLCh BaseID::LOCAL_NAME[] = UNICODE_LITERAL_6(B,a,s,e,I,D);
1587 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1588 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1589 const XMLCh Condition::LOCAL_NAME[] = UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1590 const XMLCh Conditions::LOCAL_NAME[] = UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1591 const XMLCh Conditions::TYPE_NAME[] = UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1592 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1593 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1594 const XMLCh EncryptedAssertion::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,s,s,e,r,t,i,o,n);
1595 const XMLCh EncryptedAttribute::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,t,t,r,i,b,u,t,e);
1596 const XMLCh EncryptedElementType::LOCAL_NAME[] = {chNull};
1597 const XMLCh EncryptedElementType::TYPE_NAME[] = UNICODE_LITERAL_20(E,n,c,r,y,p,t,e,d,E,l,e,m,e,n,t,T,y,p,e);
1598 const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,d);
1599 const XMLCh Evidence::LOCAL_NAME[] = UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1600 const XMLCh Evidence::TYPE_NAME[] = UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1601 const XMLCh Issuer::LOCAL_NAME[] = UNICODE_LITERAL_6(I,s,s,u,e,r);
1602 const XMLCh KeyInfoConfirmationDataType::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1603 const XMLCh KeyInfoConfirmationDataType::TYPE_NAME[] = UNICODE_LITERAL_27(K,e,y,I,n,f,o,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a,T,y,p,e);
1604 const XMLCh KeyInfoConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1605 const XMLCh KeyInfoConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1606 const XMLCh KeyInfoConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1607 const XMLCh KeyInfoConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1608 const XMLCh KeyInfoConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1609 const XMLCh NameID::LOCAL_NAME[] = UNICODE_LITERAL_6(N,a,m,e,I,D);
1610 const XMLCh NameIDType::LOCAL_NAME[] = {chNull};
1611 const XMLCh NameIDType::TYPE_NAME[] = UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1612 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1613 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1614 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
1615 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1616 const XMLCh OneTimeUse::LOCAL_NAME[] = UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1617 const XMLCh OneTimeUse::TYPE_NAME[] = UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1618 const XMLCh ProxyRestriction::LOCAL_NAME[] = UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1619 const XMLCh ProxyRestriction::TYPE_NAME[] = UNICODE_LITERAL_20(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1620 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1621 const XMLCh Statement::LOCAL_NAME[] = UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1622 const XMLCh Subject::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1623 const XMLCh Subject::TYPE_NAME[] = UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1624 const XMLCh SubjectConfirmation::LOCAL_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n);
1625 const XMLCh SubjectConfirmation::TYPE_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,T,y,p,e);
1626 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1627 const XMLCh SubjectConfirmationData::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1628 const XMLCh SubjectConfirmationData::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1629 const XMLCh SubjectConfirmationData::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1630 const XMLCh SubjectConfirmationData::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1631 const XMLCh SubjectConfirmationData::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1632 const XMLCh SubjectConfirmationData::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1633 const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1634 const XMLCh SubjectLocality::TYPE_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y,T,y,p,e);
1635 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1636 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1638 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1639 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1640 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1641 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1642 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1643 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1644 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1647 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1648 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1649 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1650 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1651 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1652 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1653 chLatin_e, chLatin_m, chLatin_a, chLatin_i, chLatin_l, chLatin_A, chLatin_d, chLatin_d, chLatin_r, chLatin_e, chLatin_s, chLatin_s, chNull
1656 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1657 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1658 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1659 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1660 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1661 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1662 chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1663 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1666 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1667 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1668 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1669 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1670 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1671 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1672 chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1673 chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1674 chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1675 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1678 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1679 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1680 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1681 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1682 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1683 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1684 chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1687 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1688 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1689 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1690 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1691 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1692 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1693 chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1696 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1697 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1698 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1699 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1700 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1701 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1702 chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1705 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1706 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1707 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1708 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1709 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1710 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1711 chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1714 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1715 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1716 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1717 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1718 chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1721 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1722 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1723 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1724 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1725 chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1726 chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1729 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1730 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1731 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1732 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1733 chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1734 chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1737 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1738 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1739 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1740 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1741 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1742 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1745 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1746 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1747 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1748 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1749 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1750 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1751 chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1754 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1755 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1756 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1757 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1758 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1759 chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1762 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1763 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1764 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1765 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1766 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1767 chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1770 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1771 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1772 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1773 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1774 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1775 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1776 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1779 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1780 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1781 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1782 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1783 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1784 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1785 chLatin_u, chLatin_r, chLatin_i, chNull
1788 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1789 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1790 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1791 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1792 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1793 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1794 chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull