2 * Copyright 2001-2007 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 xmlencryption;
41 using namespace xmlsignature;
42 using namespace xmltooling;
44 using xmlconstants::XMLSIG_NS;
45 using xmlconstants::XMLENC_NS;
46 using samlconstants::SAML20_NS;
48 #if defined (_MSC_VER)
49 #pragma warning( push )
50 #pragma warning( disable : 4250 4251 )
56 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
57 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
58 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
59 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextClassRef);
60 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthnContextDeclRef);
61 DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AuthenticatingAuthority);
63 class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType,
64 public AbstractSimpleElement,
65 public AbstractDOMCachingXMLObject,
66 public AbstractXMLObjectMarshaller,
67 public AbstractXMLObjectUnmarshaller
70 m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL;
79 virtual ~NameIDTypeImpl() {
80 XMLString::release(&m_NameQualifier);
81 XMLString::release(&m_SPNameQualifier);
82 XMLString::release(&m_Format);
83 XMLString::release(&m_SPProvidedID);
86 NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
87 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
91 NameIDTypeImpl(const NameIDTypeImpl& src)
92 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
94 setNameQualifier(src.getNameQualifier());
95 setSPNameQualifier(src.getSPNameQualifier());
96 setFormat(src.getFormat());
97 setSPProvidedID(src.getSPProvidedID());
100 IMPL_XMLOBJECT_CLONE(NameIDType);
101 IMPL_STRING_ATTRIB(NameQualifier);
102 IMPL_STRING_ATTRIB(SPNameQualifier);
103 IMPL_STRING_ATTRIB(Format);
104 IMPL_STRING_ATTRIB(SPProvidedID);
107 void marshallAttributes(DOMElement* domElement) const {
108 MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
109 MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
110 MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
111 MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
114 void processAttribute(const DOMAttr* attribute) {
115 PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL);
116 PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
117 PROC_STRING_ATTRIB(Format,FORMAT,NULL);
118 PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL);
119 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
123 class SAML_DLLLOCAL NameIDImpl : public virtual NameID, public NameIDTypeImpl
126 virtual ~NameIDImpl() {}
128 NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
129 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
131 NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
133 IMPL_XMLOBJECT_CLONE(NameID);
134 NameIDType* cloneNameIDType() const {
135 return new NameIDImpl(*this);
139 class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl
142 virtual ~IssuerImpl() {}
144 IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
145 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
147 IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {}
149 IMPL_XMLOBJECT_CLONE(Issuer);
150 NameIDType* cloneNameIDType() const {
151 return new IssuerImpl(*this);
155 //TODO unit test for this
156 // - need to test encryption/decryption too, or already done in xmltooling ?
157 class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType,
158 public AbstractComplexElement,
159 public AbstractDOMCachingXMLObject,
160 public AbstractXMLObjectMarshaller,
161 public AbstractXMLObjectUnmarshaller
164 m_EncryptedData=NULL;
165 m_children.push_back(NULL);
166 m_pos_EncryptedData=m_children.begin();
170 EncryptedElementTypeImpl() {
175 virtual ~EncryptedElementTypeImpl() {}
177 EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
178 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
182 EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src)
183 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
185 if (src.getEncryptedData())
186 setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
187 VectorOf(EncryptedKey) v=getEncryptedKeys();
188 for (vector<EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
190 v.push_back((*i)->cloneEncryptedKey());
195 XMLObject* decrypt(const CredentialResolver& credResolver, const XMLCh* recipient, CredentialCriteria* criteria) const
197 if (!m_EncryptedData)
198 throw DecryptionException("No encrypted data present.");
199 EncryptedKeyResolver ekr(*this);
200 Decrypter decrypter(&credResolver, criteria, &ekr);
201 DOMDocumentFragment* frag = decrypter.decryptData(*m_EncryptedData, recipient);
202 if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
203 DOMNode* plaintext=frag->getFirstChild();
204 if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
205 // Import the tree into a new Document that we can bind to the unmarshalled object.
206 XercesJanitor<DOMDocument> newdoc(XMLToolingConfig::getConfig().getParser().newDocument());
207 DOMElement* treecopy = static_cast<DOMElement*>(newdoc->importNode(plaintext, true));
208 newdoc->appendChild(treecopy);
209 auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(treecopy, true));
211 return ret.release();
215 throw DecryptionException("Decryption did not result in a single element.");
218 IMPL_XMLOBJECT_CLONE(EncryptedElementType);
219 IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
220 IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
223 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
224 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
225 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
226 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
230 //TODO unit test for this
231 class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
234 virtual ~EncryptedIDImpl() {}
236 EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
237 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
239 EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
241 IMPL_XMLOBJECT_CLONE(EncryptedID);
242 EncryptedElementType* cloneEncryptedElementType() const {
243 return new EncryptedIDImpl(*this);
247 class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction,
248 public AbstractComplexElement,
249 public AbstractDOMCachingXMLObject,
250 public AbstractXMLObjectMarshaller,
251 public AbstractXMLObjectUnmarshaller
254 virtual ~AudienceRestrictionImpl() {}
256 AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
257 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
260 AudienceRestrictionImpl(const AudienceRestrictionImpl& src)
261 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
262 VectorOf(Audience) v=getAudiences();
263 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
265 v.push_back((*i)->cloneAudience());
270 IMPL_XMLOBJECT_CLONE(AudienceRestriction);
271 Condition* cloneCondition() const {
272 return cloneAudienceRestriction();
274 IMPL_TYPED_CHILDREN(Audience,m_children.end());
277 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
278 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
279 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
283 class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse,
284 public AbstractSimpleElement,
285 public AbstractDOMCachingXMLObject,
286 public AbstractXMLObjectMarshaller,
287 public AbstractXMLObjectUnmarshaller
290 virtual ~OneTimeUseImpl() {}
292 OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
293 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
296 OneTimeUseImpl(const OneTimeUseImpl& src)
297 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
300 IMPL_XMLOBJECT_CLONE(OneTimeUse);
301 Condition* cloneCondition() const {
302 return cloneOneTimeUse();
306 class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction,
307 public AbstractComplexElement,
308 public AbstractDOMCachingXMLObject,
309 public AbstractXMLObjectMarshaller,
310 public AbstractXMLObjectUnmarshaller
313 virtual ~ProxyRestrictionImpl() {
314 XMLString::release(&m_Count);
317 ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
318 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
322 ProxyRestrictionImpl(const ProxyRestrictionImpl& src)
323 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
324 setCount(src.m_Count);
325 VectorOf(Audience) v=getAudiences();
326 for (vector<Audience*>::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) {
328 v.push_back((*i)->cloneAudience());
333 IMPL_XMLOBJECT_CLONE(ProxyRestriction);
334 Condition* cloneCondition() const {
335 return cloneProxyRestriction();
337 IMPL_TYPED_CHILDREN(Audience,m_children.end());
338 IMPL_INTEGER_ATTRIB(Count);
341 void marshallAttributes(DOMElement* domElement) const {
342 MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL);
345 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
346 PROC_TYPED_CHILDREN(Audience,SAML20_NS,false);
347 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
350 void processAttribute(const DOMAttr* attribute) {
351 PROC_INTEGER_ATTRIB(Count,COUNT,NULL);
352 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
357 class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions,
358 public AbstractComplexElement,
359 public AbstractDOMCachingXMLObject,
360 public AbstractXMLObjectMarshaller,
361 public AbstractXMLObjectUnmarshaller
364 m_NotBefore=m_NotOnOrAfter=NULL;
367 virtual ~ConditionsImpl() {
369 delete m_NotOnOrAfter;
372 ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
373 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
377 ConditionsImpl(const ConditionsImpl& src)
378 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
380 setNotBefore(src.getNotBefore());
381 setNotOnOrAfter(src.getNotOnOrAfter());
383 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
385 AudienceRestriction* arc=dynamic_cast<AudienceRestriction*>(*i);
387 getAudienceRestrictions().push_back(arc->cloneAudienceRestriction());
391 OneTimeUse* dncc=dynamic_cast<OneTimeUse*>(*i);
393 getOneTimeUses().push_back(dncc->cloneOneTimeUse());
397 ProxyRestriction* prc=dynamic_cast<ProxyRestriction*>(*i);
399 getProxyRestrictions().push_back(prc->cloneProxyRestriction());
403 Condition* c=dynamic_cast<Condition*>(*i);
405 getConditions().push_back(c->cloneCondition());
412 IMPL_XMLOBJECT_CLONE(Conditions);
413 IMPL_DATETIME_ATTRIB(NotBefore,0);
414 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
415 IMPL_TYPED_CHILDREN(AudienceRestriction, m_children.end());
416 IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end());
417 IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end());
418 IMPL_TYPED_CHILDREN(Condition,m_children.end());
421 void marshallAttributes(DOMElement* domElement) const {
422 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
423 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
426 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
427 PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false);
428 PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false);
429 PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false);
430 PROC_TYPED_CHILDREN(Condition,SAML20_NS,false);
431 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
434 void processAttribute(const DOMAttr* attribute) {
435 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
436 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
437 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
441 class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType,
442 public AbstractDOMCachingXMLObject,
443 public AbstractXMLObjectMarshaller,
444 public AbstractXMLObjectUnmarshaller
447 m_NotBefore=m_NotOnOrAfter=NULL;
448 m_Recipient=m_InResponseTo=m_Address=NULL;
452 SubjectConfirmationDataTypeImpl() {
457 virtual ~SubjectConfirmationDataTypeImpl() {
459 delete m_NotOnOrAfter;
460 XMLString::release(&m_Recipient);
461 XMLString::release(&m_InResponseTo);
462 XMLString::release(&m_Address);
465 SubjectConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
466 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
470 SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractDOMCachingXMLObject(src) {
472 setNotBefore(src.getNotBefore());
473 setNotOnOrAfter(src.getNotOnOrAfter());
474 setRecipient(src.getRecipient());
475 setInResponseTo(src.getInResponseTo());
476 setAddress(src.getAddress());
479 IMPL_DATETIME_ATTRIB(NotBefore,0);
480 IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
481 IMPL_STRING_ATTRIB(Recipient);
482 IMPL_STRING_ATTRIB(InResponseTo);
483 IMPL_STRING_ATTRIB(Address);
486 void marshallAttributes(DOMElement* domElement) const {
487 MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
488 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
489 MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
490 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
491 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
494 void processAttribute(const DOMAttr* attribute) {
495 PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
496 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
497 PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
498 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
499 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
500 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
504 class SAML_DLLLOCAL SubjectConfirmationDataImpl : public SubjectConfirmationData,
505 public SubjectConfirmationDataTypeImpl, public AnyElementImpl
508 virtual ~SubjectConfirmationDataImpl() {}
510 SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
511 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
514 SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src)
515 : SubjectConfirmationDataTypeImpl(src), AnyElementImpl(src) {
518 IMPL_XMLOBJECT_CLONE(SubjectConfirmationData);
519 SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
520 return new SubjectConfirmationDataImpl(*this);
523 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
524 if (!qualifiedName.hasNamespaceURI()) {
525 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
529 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
530 setNotOnOrAfter(value);
533 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
537 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
538 setInResponseTo(value);
541 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
546 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
550 void marshallAttributes(DOMElement* domElement) const {
551 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
552 AnyElementImpl::marshallAttributes(domElement);
556 class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
557 public SubjectConfirmationDataTypeImpl,
558 public AbstractComplexElement,
559 public AbstractAttributeExtensibleXMLObject
562 virtual ~KeyInfoConfirmationDataTypeImpl() {}
564 KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
565 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
568 KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
569 : AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AbstractComplexElement(src),
570 AbstractAttributeExtensibleXMLObject(src) {
571 VectorOf(KeyInfo) v=getKeyInfos();
572 for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
573 v.push_back((*i)->cloneKeyInfo());
576 IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
577 SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const {
578 return new KeyInfoConfirmationDataTypeImpl(*this);
581 IMPL_TYPED_CHILDREN(KeyInfo,m_children.end());
584 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
585 if (!qualifiedName.hasNamespaceURI()) {
586 if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) {
590 else if (XMLString::equals(qualifiedName.getLocalPart(),NOTONORAFTER_ATTRIB_NAME)) {
591 setNotOnOrAfter(value);
594 else if (XMLString::equals(qualifiedName.getLocalPart(),RECIPIENT_ATTRIB_NAME)) {
598 else if (XMLString::equals(qualifiedName.getLocalPart(),INRESPONSETO_ATTRIB_NAME)) {
599 setInResponseTo(value);
602 else if (XMLString::equals(qualifiedName.getLocalPart(),ADDRESS_ATTRIB_NAME)) {
607 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
611 void marshallAttributes(DOMElement* domElement) const {
612 SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
613 marshallExtensionAttributes(domElement);
616 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
617 PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false);
618 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
621 void processAttribute(const DOMAttr* attribute) {
622 unmarshallExtensionAttribute(attribute);
626 class SAML_DLLLOCAL SubjectConfirmationImpl : public virtual SubjectConfirmation,
627 public AbstractComplexElement,
628 public AbstractDOMCachingXMLObject,
629 public AbstractXMLObjectMarshaller,
630 public AbstractXMLObjectUnmarshaller
637 m_SubjectConfirmationData=NULL;
638 m_children.push_back(NULL);
639 m_children.push_back(NULL);
640 m_children.push_back(NULL);
641 m_children.push_back(NULL);
642 m_pos_BaseID=m_children.begin();
643 m_pos_NameID=m_pos_BaseID;
645 m_pos_EncryptedID=m_pos_NameID;
647 m_pos_SubjectConfirmationData=m_pos_EncryptedID;
648 ++m_pos_SubjectConfirmationData;
651 virtual ~SubjectConfirmationImpl() {}
653 SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
654 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
658 SubjectConfirmationImpl(const SubjectConfirmationImpl& src)
659 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
661 setMethod(src.getMethod());
663 setBaseID(src.getBaseID()->cloneBaseID());
665 setNameID(src.getNameID()->cloneNameID());
666 if (src.getEncryptedID())
667 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
668 if (src.getSubjectConfirmationData())
669 setSubjectConfirmationData(src.getSubjectConfirmationData()->clone());
672 IMPL_XMLOBJECT_CLONE(SubjectConfirmation);
673 IMPL_STRING_ATTRIB(Method);
674 IMPL_TYPED_CHILD(BaseID);
675 IMPL_TYPED_CHILD(NameID);
676 IMPL_TYPED_CHILD(EncryptedID);
677 IMPL_XMLOBJECT_CHILD(SubjectConfirmationData);
680 void marshallAttributes(DOMElement* domElement) const {
681 MARSHALL_STRING_ATTRIB(Method,METHOD,NULL);
684 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
685 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
686 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
687 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
688 PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS);
689 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
692 void processAttribute(const DOMAttr* attribute) {
693 PROC_STRING_ATTRIB(Method,METHOD,NULL);
694 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
698 class SAML_DLLLOCAL SubjectImpl : public virtual Subject,
699 public AbstractComplexElement,
700 public AbstractDOMCachingXMLObject,
701 public AbstractXMLObjectMarshaller,
702 public AbstractXMLObjectUnmarshaller
708 m_children.push_back(NULL);
709 m_children.push_back(NULL);
710 m_children.push_back(NULL);
711 m_pos_BaseID=m_children.begin();
712 m_pos_NameID=m_pos_BaseID;
714 m_pos_EncryptedID=m_pos_NameID;
718 virtual ~SubjectImpl() {}
720 SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
721 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
725 SubjectImpl(const SubjectImpl& src)
726 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
729 setBaseID(src.getBaseID()->cloneBaseID());
731 setNameID(src.getNameID()->cloneNameID());
732 if (src.getEncryptedID())
733 setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
734 VectorOf(SubjectConfirmation) v=getSubjectConfirmations();
735 for (vector<SubjectConfirmation*>::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) {
737 v.push_back((*i)->cloneSubjectConfirmation());
742 IMPL_XMLOBJECT_CLONE(Subject);
743 IMPL_TYPED_CHILD(NameID);
744 IMPL_TYPED_CHILD(BaseID);
745 IMPL_TYPED_CHILD(EncryptedID);
746 IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end());
749 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
750 PROC_TYPED_CHILD(BaseID,SAML20_NS,false);
751 PROC_TYPED_CHILD(NameID,SAML20_NS,false);
752 PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false);
753 PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false);
754 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
758 class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality,
759 public AbstractSimpleElement,
760 public AbstractDOMCachingXMLObject,
761 public AbstractXMLObjectMarshaller,
762 public AbstractXMLObjectUnmarshaller
765 m_Address=m_DNSName=NULL;
768 virtual ~SubjectLocalityImpl() {
769 XMLString::release(&m_Address);
770 XMLString::release(&m_DNSName);
773 SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
774 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
778 SubjectLocalityImpl(const SubjectLocalityImpl& src)
779 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
781 setAddress(src.getAddress());
782 setDNSName(src.getDNSName());
785 IMPL_XMLOBJECT_CLONE(SubjectLocality);
786 IMPL_STRING_ATTRIB(Address);
787 IMPL_STRING_ATTRIB(DNSName);
790 void marshallAttributes(DOMElement* domElement) const {
791 MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL);
792 MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL);
795 void processAttribute(const DOMAttr* attribute) {
796 PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
797 PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL);
798 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
802 //TODO need unit test for this
803 class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl
806 virtual ~AuthnContextDeclImpl() {}
808 AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
809 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
812 AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) {
815 IMPL_XMLOBJECT_CLONE(AuthnContextDecl);
818 class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext,
819 public AbstractComplexElement,
820 public AbstractDOMCachingXMLObject,
821 public AbstractXMLObjectMarshaller,
822 public AbstractXMLObjectUnmarshaller
825 m_AuthnContextClassRef=NULL;
826 m_AuthnContextDecl=NULL;
827 m_AuthnContextDeclRef=NULL;
828 m_children.push_back(NULL);
829 m_children.push_back(NULL);
830 m_children.push_back(NULL);
831 m_pos_AuthnContextClassRef=m_children.begin();
832 m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef;
833 ++m_pos_AuthnContextDecl;
834 m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl;
835 ++m_pos_AuthnContextDeclRef;
838 virtual ~AuthnContextImpl() {}
840 AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
841 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
845 AuthnContextImpl(const AuthnContextImpl& src)
846 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
848 if (src.getAuthnContextClassRef())
849 setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef());
850 if (src.getAuthnContextDecl())
851 setAuthnContextDecl(src.getAuthnContextDecl()->clone());
852 if (src.getAuthnContextDeclRef())
853 setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef());
854 VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys();
855 for (vector<AuthenticatingAuthority*>::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) {
857 v.push_back((*i)->cloneAuthenticatingAuthority());
862 IMPL_XMLOBJECT_CLONE(AuthnContext);
863 IMPL_TYPED_CHILD(AuthnContextClassRef);
864 IMPL_XMLOBJECT_CHILD(AuthnContextDecl);
865 IMPL_TYPED_CHILD(AuthnContextDeclRef);
866 IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end());
869 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
870 PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false);
871 PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS);
872 PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false);
873 PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false);
874 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
878 class SAML_DLLLOCAL AuthnStatementImpl : public virtual AuthnStatement,
879 public AbstractComplexElement,
880 public AbstractDOMCachingXMLObject,
881 public AbstractXMLObjectMarshaller,
882 public AbstractXMLObjectUnmarshaller
887 m_SessionNotOnOrAfter=NULL;
888 m_SubjectLocality=NULL;
890 m_children.push_back(NULL);
891 m_children.push_back(NULL);
892 m_pos_SubjectLocality=m_children.begin();
893 m_pos_AuthnContext=m_pos_SubjectLocality;
894 ++m_pos_AuthnContext;
897 virtual ~AuthnStatementImpl() {
898 delete m_AuthnInstant;
899 XMLString::release(&m_SessionIndex);
900 delete m_SessionNotOnOrAfter;
903 AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
904 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
908 AuthnStatementImpl(const AuthnStatementImpl& src)
909 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
911 setAuthnInstant(src.getAuthnInstant());
912 setSessionIndex(src.getSessionIndex());
913 setSessionNotOnOrAfter(src.getSessionNotOnOrAfter());
914 if (src.getSubjectLocality())
915 setSubjectLocality(src.getSubjectLocality()->cloneSubjectLocality());
916 if (src.getAuthnContext())
917 setAuthnContext(src.getAuthnContext()->cloneAuthnContext());
920 IMPL_XMLOBJECT_CLONE(AuthnStatement);
921 Statement* cloneStatement() const {
922 return cloneAuthnStatement();
924 IMPL_DATETIME_ATTRIB(AuthnInstant,0);
925 IMPL_STRING_ATTRIB(SessionIndex);
926 IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX);
927 IMPL_TYPED_CHILD(SubjectLocality);
928 IMPL_TYPED_CHILD(AuthnContext);
931 void marshallAttributes(DOMElement* domElement) const {
932 MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
933 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
934 MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
937 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
938 PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false);
939 PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false);
940 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
943 void processAttribute(const DOMAttr* attribute) {
944 PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL);
945 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
946 PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL);
947 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
951 class SAML_DLLLOCAL ActionImpl : public virtual Action,
952 public AbstractSimpleElement,
953 public AbstractDOMCachingXMLObject,
954 public AbstractXMLObjectMarshaller,
955 public AbstractXMLObjectUnmarshaller
958 virtual ~ActionImpl() {
959 XMLString::release(&m_Namespace);
962 ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
963 : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) {
966 ActionImpl(const ActionImpl& src)
967 : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
968 setNamespace(src.getNamespace());
971 IMPL_XMLOBJECT_CLONE(Action);
972 IMPL_STRING_ATTRIB(Namespace);
975 void marshallAttributes(DOMElement* domElement) const {
976 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
979 void processAttribute(const DOMAttr* attribute) {
980 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
981 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
985 class SAML_DLLLOCAL EvidenceImpl : public virtual Evidence,
986 public AbstractComplexElement,
987 public AbstractDOMCachingXMLObject,
988 public AbstractXMLObjectMarshaller,
989 public AbstractXMLObjectUnmarshaller
992 virtual ~EvidenceImpl() {}
994 EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
995 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
998 EvidenceImpl(const EvidenceImpl& src)
999 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1000 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1002 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1004 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1008 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1010 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1014 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1016 getAssertions().push_back(assertion->cloneAssertion());
1020 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1022 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1029 IMPL_XMLOBJECT_CLONE(Evidence);
1030 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1031 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1032 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1033 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1036 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1037 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1038 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1039 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1040 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1041 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1045 class SAML_DLLLOCAL AuthzDecisionStatementImpl : public virtual AuthzDecisionStatement,
1046 public AbstractComplexElement,
1047 public AbstractDOMCachingXMLObject,
1048 public AbstractXMLObjectMarshaller,
1049 public AbstractXMLObjectUnmarshaller
1055 m_children.push_back(NULL);
1056 m_pos_Evidence=m_children.begin();
1059 virtual ~AuthzDecisionStatementImpl() {
1060 XMLString::release(&m_Resource);
1061 XMLString::release(&m_Decision);
1064 AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1065 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1069 AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src)
1070 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1072 setResource(src.getResource());
1073 setDecision(src.getDecision());
1074 if (src.getEvidence())
1075 setEvidence(src.getEvidence()->cloneEvidence());
1076 VectorOf(Action) v=getActions();
1077 for (vector<Action*>::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) {
1079 v.push_back((*i)->cloneAction());
1084 IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement);
1085 Statement* cloneStatement() const {
1086 return cloneAuthzDecisionStatement();
1088 IMPL_STRING_ATTRIB(Resource);
1089 IMPL_STRING_ATTRIB(Decision);
1090 IMPL_TYPED_CHILD(Evidence);
1091 IMPL_TYPED_CHILDREN(Action, m_pos_Evidence);
1094 void marshallAttributes(DOMElement* domElement) const {
1095 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
1096 MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL);
1099 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1100 PROC_TYPED_CHILD(Evidence,SAML20_NS,false);
1101 PROC_TYPED_CHILDREN(Action,SAML20_NS,false);
1102 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1105 void processAttribute(const DOMAttr* attribute) {
1106 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
1107 PROC_STRING_ATTRIB(Decision,DECISION,NULL);
1108 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1112 //TODO need unit test for this
1113 class SAML_DLLLOCAL AttributeValueImpl : public virtual AttributeValue, public AnyElementImpl
1116 virtual ~AttributeValueImpl() {}
1118 AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1119 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1122 AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) {
1125 IMPL_XMLOBJECT_CLONE(AttributeValue);
1129 class SAML_DLLLOCAL AttributeImpl : public virtual Attribute,
1130 public AbstractComplexElement,
1131 public AbstractAttributeExtensibleXMLObject,
1132 public AbstractDOMCachingXMLObject,
1133 public AbstractXMLObjectMarshaller,
1134 public AbstractXMLObjectUnmarshaller
1137 m_Name=m_NameFormat=m_FriendlyName=NULL;
1140 virtual ~AttributeImpl() {
1141 XMLString::release(&m_Name);
1142 XMLString::release(&m_NameFormat);
1143 XMLString::release(&m_FriendlyName);
1146 AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1147 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1151 AttributeImpl(const AttributeImpl& src)
1152 : AbstractXMLObject(src), AbstractComplexElement(src),
1153 AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1155 setName(src.getName());
1156 setNameFormat(src.getNameFormat());
1157 setFriendlyName(src.getFriendlyName());
1158 VectorOf(XMLObject) v=getAttributeValues();
1159 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1161 v.push_back((*i)->clone());
1166 IMPL_XMLOBJECT_CLONE(Attribute);
1167 IMPL_STRING_ATTRIB(Name);
1168 IMPL_STRING_ATTRIB(NameFormat);
1169 IMPL_STRING_ATTRIB(FriendlyName);
1170 IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1172 void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
1173 if (!qualifiedName.hasNamespaceURI()) {
1174 if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1178 else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1179 setNameFormat(value);
1182 else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1183 setFriendlyName(value);
1187 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1191 void marshallAttributes(DOMElement* domElement) const {
1192 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1193 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1194 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1195 marshallExtensionAttributes(domElement);
1198 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1199 getAttributeValues().push_back(childXMLObject);
1202 void processAttribute(const DOMAttr* attribute) {
1203 unmarshallExtensionAttribute(attribute);
1207 //TODO unit test for this
1208 class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl
1211 virtual ~EncryptedAttributeImpl() {}
1213 EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1214 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1216 EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1218 IMPL_XMLOBJECT_CLONE(EncryptedAttribute);
1219 EncryptedElementType* cloneEncryptedElementType() const {
1220 return new EncryptedAttributeImpl(*this);
1224 class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement,
1225 public AbstractComplexElement,
1226 public AbstractDOMCachingXMLObject,
1227 public AbstractXMLObjectMarshaller,
1228 public AbstractXMLObjectUnmarshaller
1231 virtual ~AttributeStatementImpl() {}
1233 AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1234 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1237 AttributeStatementImpl(const AttributeStatementImpl& src)
1238 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1239 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1241 Attribute* attribute=dynamic_cast<Attribute*>(*i);
1243 getAttributes().push_back(attribute->cloneAttribute());
1247 EncryptedAttribute* enc=dynamic_cast<EncryptedAttribute*>(*i);
1249 getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute());
1256 IMPL_XMLOBJECT_CLONE(AttributeStatement);
1257 Statement* cloneStatement() const {
1258 return cloneAttributeStatement();
1260 IMPL_TYPED_CHILDREN(Attribute, m_children.end());
1261 IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end());
1264 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1265 PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false);
1266 PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false);
1267 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1271 class SAML_DLLLOCAL AdviceImpl : public virtual Advice,
1272 public AbstractComplexElement,
1273 public AbstractDOMCachingXMLObject,
1274 public AbstractXMLObjectMarshaller,
1275 public AbstractXMLObjectUnmarshaller
1278 virtual ~AdviceImpl() {}
1280 AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1281 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1284 AdviceImpl(const AdviceImpl& src)
1285 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1286 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1288 AssertionIDRef* ref=dynamic_cast<AssertionIDRef*>(*i);
1290 getAssertionIDRefs().push_back(ref->cloneAssertionIDRef());
1294 AssertionURIRef* uri=dynamic_cast<AssertionURIRef*>(*i);
1296 getAssertionURIRefs().push_back(uri->cloneAssertionURIRef());
1300 Assertion* assertion=dynamic_cast<Assertion*>(*i);
1302 getAssertions().push_back(assertion->cloneAssertion());
1306 EncryptedAssertion* enc=dynamic_cast<EncryptedAssertion*>(*i);
1308 getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion());
1312 getUnknownXMLObjects().push_back((*i)->clone());
1317 IMPL_XMLOBJECT_CLONE(Advice);
1318 IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end());
1319 IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
1320 IMPL_TYPED_CHILDREN(Assertion,m_children.end());
1321 IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
1322 IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
1325 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1326 PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false);
1327 PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false);
1328 PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false);
1329 PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false);
1332 const XMLCh* nsURI=root->getNamespaceURI();
1333 if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) {
1334 getUnknownXMLObjects().push_back(childXMLObject);
1338 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1342 //TODO unit test for this
1343 class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl
1346 virtual ~EncryptedAssertionImpl() {}
1348 EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1349 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1351 EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {}
1353 IMPL_XMLOBJECT_CLONE(EncryptedAssertion);
1354 EncryptedElementType* cloneEncryptedElementType() const {
1355 return new EncryptedAssertionImpl(*this);
1359 class SAML_DLLLOCAL AssertionImpl : public virtual Assertion,
1360 public AbstractComplexElement,
1361 public AbstractDOMCachingXMLObject,
1362 public AbstractXMLObjectMarshaller,
1363 public AbstractXMLObjectUnmarshaller
1368 m_IssueInstant=NULL;
1374 m_children.push_back(NULL);
1375 m_children.push_back(NULL);
1376 m_children.push_back(NULL);
1377 m_children.push_back(NULL);
1378 m_children.push_back(NULL);
1379 m_pos_Issuer=m_children.begin();
1380 m_pos_Signature=m_pos_Issuer;
1382 m_pos_Subject=m_pos_Signature;
1384 m_pos_Conditions=m_pos_Subject;
1386 m_pos_Advice=m_pos_Conditions;
1390 virtual ~AssertionImpl() {
1391 XMLString::release(&m_ID);
1392 XMLString::release(&m_Version);
1393 delete m_IssueInstant;
1396 AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1397 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1401 AssertionImpl(const AssertionImpl& src)
1402 : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1404 setVersion(src.getVersion());
1406 setIssueInstant(src.getIssueInstant());
1407 if (src.getIssuer())
1408 setIssuer(src.getIssuer()->cloneIssuer());
1409 if (src.getSignature())
1410 setSignature(src.getSignature()->cloneSignature());
1411 if (src.getSubject())
1412 setSubject(src.getSubject()->cloneSubject());
1413 if (src.getConditions())
1414 setConditions(src.getConditions()->cloneConditions());
1415 if (src.getAdvice())
1416 setAdvice(src.getAdvice()->cloneAdvice());
1417 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1419 AuthnStatement* authst=dynamic_cast<AuthnStatement*>(*i);
1421 getAuthnStatements().push_back(authst->cloneAuthnStatement());
1425 AttributeStatement* attst=dynamic_cast<AttributeStatement*>(*i);
1427 getAttributeStatements().push_back(attst->cloneAttributeStatement());
1431 AuthzDecisionStatement* authzst=dynamic_cast<AuthzDecisionStatement*>(*i);
1433 getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement());
1437 Statement* st=dynamic_cast<Statement*>(*i);
1439 getStatements().push_back(st->cloneStatement());
1446 //IMPL_TYPED_CHILD(Signature);
1447 // Need customized setter.
1449 Signature* m_Signature;
1450 list<XMLObject*>::iterator m_pos_Signature;
1452 Signature* getSignature() const {
1456 void setSignature(Signature* sig) {
1457 prepareForAssignment(m_Signature,sig);
1458 *m_pos_Signature=m_Signature=sig;
1459 // Sync content reference back up.
1461 m_Signature->setContentReference(new opensaml::ContentReference(*this));
1464 IMPL_XMLOBJECT_CLONE(Assertion);
1465 IMPL_STRING_ATTRIB(Version);
1467 IMPL_DATETIME_ATTRIB(IssueInstant,0);
1468 IMPL_TYPED_CHILD(Issuer);
1469 IMPL_TYPED_CHILD(Subject);
1470 IMPL_TYPED_CHILD(Conditions);
1471 IMPL_TYPED_CHILD(Advice);
1472 IMPL_TYPED_CHILDREN(Statement, m_children.end());
1473 IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end());
1474 IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end());
1475 IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end());
1478 void marshallAttributes(DOMElement* domElement) const {
1480 const_cast<AssertionImpl*>(this)->m_Version=XMLString::transcode("2.0");
1481 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1483 const_cast<AssertionImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1484 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1485 if (!m_IssueInstant) {
1486 const_cast<AssertionImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1487 const_cast<AssertionImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1489 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1492 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1493 PROC_TYPED_CHILD(Issuer,SAML20_NS,false);
1494 PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
1495 PROC_TYPED_CHILD(Subject,SAML20_NS,false);
1496 PROC_TYPED_CHILD(Conditions,SAML20_NS,false);
1497 PROC_TYPED_CHILD(Advice,SAML20_NS,false);
1498 PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false);
1499 PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false);
1500 PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false);
1501 PROC_TYPED_CHILDREN(Statement,SAML20_NS,false);
1502 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1505 void processAttribute(const DOMAttr* attribute) {
1506 PROC_STRING_ATTRIB(Version,VER,NULL);
1507 PROC_ID_ATTRIB(ID,ID,NULL);
1508 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1509 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1516 #if defined (_MSC_VER)
1517 #pragma warning( pop )
1520 // Builder Implementations
1522 IMPL_XMLOBJECTBUILDER(Action);
1523 IMPL_XMLOBJECTBUILDER(Advice);
1524 IMPL_XMLOBJECTBUILDER(Assertion);
1525 IMPL_XMLOBJECTBUILDER(AssertionIDRef);
1526 IMPL_XMLOBJECTBUILDER(AssertionURIRef);
1527 IMPL_XMLOBJECTBUILDER(Attribute);
1528 IMPL_XMLOBJECTBUILDER(AttributeStatement);
1529 IMPL_XMLOBJECTBUILDER(AttributeValue);
1530 IMPL_XMLOBJECTBUILDER(Audience);
1531 IMPL_XMLOBJECTBUILDER(AudienceRestriction);
1532 IMPL_XMLOBJECTBUILDER(AuthenticatingAuthority);
1533 IMPL_XMLOBJECTBUILDER(AuthnContext);
1534 IMPL_XMLOBJECTBUILDER(AuthnContextClassRef);
1535 IMPL_XMLOBJECTBUILDER(AuthnContextDecl);
1536 IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef);
1537 IMPL_XMLOBJECTBUILDER(AuthnStatement);
1538 IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement);
1539 IMPL_XMLOBJECTBUILDER(Conditions);
1540 IMPL_XMLOBJECTBUILDER(EncryptedAssertion);
1541 IMPL_XMLOBJECTBUILDER(EncryptedAttribute);
1542 IMPL_XMLOBJECTBUILDER(EncryptedID);
1543 IMPL_XMLOBJECTBUILDER(Evidence);
1544 IMPL_XMLOBJECTBUILDER(Issuer);
1545 IMPL_XMLOBJECTBUILDER(KeyInfoConfirmationDataType);
1546 IMPL_XMLOBJECTBUILDER(NameID);
1547 IMPL_XMLOBJECTBUILDER(NameIDType);
1548 IMPL_XMLOBJECTBUILDER(OneTimeUse);
1549 IMPL_XMLOBJECTBUILDER(ProxyRestriction);
1550 IMPL_XMLOBJECTBUILDER(Subject);
1551 IMPL_XMLOBJECTBUILDER(SubjectConfirmation);
1552 IMPL_XMLOBJECTBUILDER(SubjectConfirmationData);
1553 IMPL_XMLOBJECTBUILDER(SubjectLocality);
1556 const XMLCh Action::LOCAL_NAME[] = UNICODE_LITERAL_6(A,c,t,i,o,n);
1557 const XMLCh Action::TYPE_NAME[] = UNICODE_LITERAL_10(A,c,t,i,o,n,T,y,p,e);
1558 const XMLCh Action::NAMESPACE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,a,m,e,s,p,a,c,e);
1559 const XMLCh Advice::LOCAL_NAME[] = UNICODE_LITERAL_6(A,d,v,i,c,e);
1560 const XMLCh Advice::TYPE_NAME[] = UNICODE_LITERAL_10(A,d,v,i,c,e,T,y,p,e);
1561 const XMLCh Assertion::LOCAL_NAME[] = UNICODE_LITERAL_9(A,s,s,e,r,t,i,o,n);
1562 const XMLCh Assertion::TYPE_NAME[] = UNICODE_LITERAL_13(A,s,s,e,r,t,i,o,n,T,y,p,e);
1563 const XMLCh Assertion::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1564 const XMLCh Assertion::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1565 const XMLCh Assertion::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1566 const XMLCh AssertionIDRef::LOCAL_NAME[] = UNICODE_LITERAL_14(A,s,s,e,r,t,i,o,n,I,D,R,e,f);
1567 const XMLCh AssertionURIRef::LOCAL_NAME[] = UNICODE_LITERAL_15(A,s,s,e,r,t,i,o,n,U,R,I,R,e,f);
1568 const XMLCh Attribute::LOCAL_NAME[] = UNICODE_LITERAL_9(A,t,t,r,i,b,u,t,e);
1569 const XMLCh Attribute::TYPE_NAME[] = UNICODE_LITERAL_13(A,t,t,r,i,b,u,t,e,T,y,p,e);
1570 const XMLCh Attribute::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
1571 const XMLCh Attribute::NAMEFORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_10(N,a,m,e,F,o,r,m,a,t);
1572 const XMLCh Attribute::FRIENDLYNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(F,r,i,e,n,d,l,y,N,a,m,e);
1573 const XMLCh AttributeStatement::LOCAL_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t);
1574 const XMLCh AttributeStatement::TYPE_NAME[] = UNICODE_LITERAL_22(A,t,t,r,i,b,u,t,e,S,t,a,t,e,m,e,n,t,T,y,p,e);
1575 const XMLCh AttributeValue::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,V,a,l,u,e);
1576 const XMLCh Audience::LOCAL_NAME[] = UNICODE_LITERAL_8(A,u,d,i,e,n,c,e);
1577 const XMLCh AudienceRestriction::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n);
1578 const XMLCh AudienceRestriction::TYPE_NAME[] = UNICODE_LITERAL_23(A,u,d,i,e,n,c,e,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1579 const XMLCh AuthenticatingAuthority::LOCAL_NAME[] = UNICODE_LITERAL_23(A,u,t,h,e,n,t,i,c,a,t,i,n,g,A,u,t,h,o,r,i,t,y);
1580 const XMLCh AuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,C,o,n,t,e,x,t);
1581 const XMLCh AuthnContext::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1582 const XMLCh AuthnContextClassRef::LOCAL_NAME[] = UNICODE_LITERAL_20(A,u,t,h,n,C,o,n,t,e,x,t,C,l,a,s,s,R,e,f);
1583 const XMLCh AuthnContextDecl::LOCAL_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l);
1584 const XMLCh AuthnContextDeclRef::LOCAL_NAME[] = UNICODE_LITERAL_19(A,u,t,h,n,C,o,n,t,e,x,t,D,e,c,l,R,e,f);
1585 const XMLCh AuthnStatement::LOCAL_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,S,t,a,t,e,m,e,n,t);
1586 const XMLCh AuthnStatement::TYPE_NAME[] = UNICODE_LITERAL_18(A,u,t,h,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1587 const XMLCh AuthnStatement::AUTHNINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,I,n,s,t,a,n,t);
1588 const XMLCh AuthnStatement::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1589 const XMLCh AuthnStatement::SESSIONNOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_19(S,e,s,s,i,o,n,N,o,t,O,n,O,r,A,f,t,e,r);
1590 const XMLCh AuthzDecisionStatement::LOCAL_NAME[] = UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t);
1591 const XMLCh AuthzDecisionStatement::TYPE_NAME[] = UNICODE_LITERAL_26(A,u,t,h,z,D,e,c,i,s,i,o,n,S,t,a,t,e,m,e,n,t,T,y,p,e);
1592 const XMLCh AuthzDecisionStatement::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1593 const XMLCh AuthzDecisionStatement::DECISION_ATTRIB_NAME[] = UNICODE_LITERAL_8(D,e,c,i,s,i,o,n);
1594 const XMLCh AuthzDecisionStatement::DECISION_PERMIT[] = UNICODE_LITERAL_6(P,e,r,m,i,t);
1595 const XMLCh AuthzDecisionStatement::DECISION_DENY[] = UNICODE_LITERAL_4(D,e,n,y);
1596 const XMLCh AuthzDecisionStatement::DECISION_INDETERMINATE[] = UNICODE_LITERAL_13(I,n,d,e,t,e,r,m,i,n,a,t,e);
1597 const XMLCh BaseID::LOCAL_NAME[] = UNICODE_LITERAL_6(B,a,s,e,I,D);
1598 const XMLCh BaseID::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1599 const XMLCh BaseID::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1600 const XMLCh Condition::LOCAL_NAME[] = UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n);
1601 const XMLCh Conditions::LOCAL_NAME[] = UNICODE_LITERAL_10(C,o,n,d,i,t,i,o,n,s);
1602 const XMLCh Conditions::TYPE_NAME[] = UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e);
1603 const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1604 const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1605 const XMLCh EncryptedAssertion::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,s,s,e,r,t,i,o,n);
1606 const XMLCh EncryptedAttribute::LOCAL_NAME[] = UNICODE_LITERAL_18(E,n,c,r,y,p,t,e,d,A,t,t,r,i,b,u,t,e);
1607 const XMLCh EncryptedElementType::LOCAL_NAME[] = {chNull};
1608 const XMLCh EncryptedElementType::TYPE_NAME[] = UNICODE_LITERAL_20(E,n,c,r,y,p,t,e,d,E,l,e,m,e,n,t,T,y,p,e);
1609 const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,d);
1610 const XMLCh Evidence::LOCAL_NAME[] = UNICODE_LITERAL_8(E,v,i,d,e,n,c,e);
1611 const XMLCh Evidence::TYPE_NAME[] = UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e);
1612 const XMLCh Issuer::LOCAL_NAME[] = UNICODE_LITERAL_6(I,s,s,u,e,r);
1613 const XMLCh KeyInfoConfirmationDataType::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1614 const XMLCh KeyInfoConfirmationDataType::TYPE_NAME[] = UNICODE_LITERAL_27(K,e,y,I,n,f,o,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a,T,y,p,e);
1615 const XMLCh NameID::LOCAL_NAME[] = UNICODE_LITERAL_6(N,a,m,e,I,D);
1616 const XMLCh NameIDType::LOCAL_NAME[] = {chNull};
1617 const XMLCh NameIDType::TYPE_NAME[] = UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e);
1618 const XMLCh NameIDType::NAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_13(N,a,m,e,Q,u,a,l,i,f,i,e,r);
1619 const XMLCh NameIDType::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1620 const XMLCh NameIDType::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
1621 const XMLCh NameIDType::SPPROVIDEDID_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,P,P,r,o,v,i,d,e,d,I,D);
1622 const XMLCh OneTimeUse::LOCAL_NAME[] = UNICODE_LITERAL_10(O,n,e,T,i,m,e,U,s,e);
1623 const XMLCh OneTimeUse::TYPE_NAME[] = UNICODE_LITERAL_14(O,n,e,T,i,m,e,U,s,e,T,y,p,e);
1624 const XMLCh ProxyRestriction::LOCAL_NAME[] = UNICODE_LITERAL_16(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n);
1625 const XMLCh ProxyRestriction::TYPE_NAME[] = UNICODE_LITERAL_20(P,r,o,x,y,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e);
1626 const XMLCh ProxyRestriction::COUNT_ATTRIB_NAME[] = UNICODE_LITERAL_5(C,o,u,n,t);
1627 const XMLCh Statement::LOCAL_NAME[] = UNICODE_LITERAL_9(S,t,a,t,e,m,e,n,t);
1628 const XMLCh Subject::LOCAL_NAME[] = UNICODE_LITERAL_7(S,u,b,j,e,c,t);
1629 const XMLCh Subject::TYPE_NAME[] = UNICODE_LITERAL_11(S,u,b,j,e,c,t,T,y,p,e);
1630 const XMLCh SubjectConfirmation::LOCAL_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n);
1631 const XMLCh SubjectConfirmation::TYPE_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,T,y,p,e);
1632 const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d);
1633 const XMLCh SubjectConfirmationData::LOCAL_NAME[] = UNICODE_LITERAL_23(S,u,b,j,e,c,t,C,o,n,f,i,r,m,a,t,i,o,n,D,a,t,a);
1634 const XMLCh SubjectConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e);
1635 const XMLCh SubjectConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1636 const XMLCh SubjectConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1637 const XMLCh SubjectConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t);
1638 const XMLCh SubjectConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1639 const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y);
1640 const XMLCh SubjectLocality::TYPE_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y,T,y,p,e);
1641 const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s);
1642 const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e);
1644 const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
1645 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1646 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1647 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1648 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1649 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1650 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1653 const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
1654 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1655 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1656 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1657 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1658 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1659 chLatin_e, chLatin_m, chLatin_a, chLatin_i, chLatin_l, chLatin_A, chLatin_d, chLatin_d, chLatin_r, chLatin_e, chLatin_s, chLatin_s, chNull
1662 const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName
1663 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1664 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1665 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1666 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1667 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1668 chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t,
1669 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1672 const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName
1673 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1674 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1675 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon,
1676 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1677 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1678 chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s,
1679 chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n,
1680 chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d,
1681 chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull
1684 const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos
1685 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1686 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1687 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1688 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1689 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1690 chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull
1693 const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity
1694 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1695 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1696 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1697 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1698 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1699 chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull
1702 const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
1703 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1704 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1705 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1706 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1707 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1708 chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull
1711 const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient
1712 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1713 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1714 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1715 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash,
1716 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1717 chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull
1720 const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer
1721 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1722 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1723 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1724 chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull
1727 const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key
1728 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1729 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1730 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1731 chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash,
1732 chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull
1735 const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches
1736 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1737 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1738 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1739 chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash,
1740 chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull
1743 const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc
1744 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1745 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1746 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1747 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1748 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull
1751 const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation
1752 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1753 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1754 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1755 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1756 chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash,
1757 chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull
1760 const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp
1761 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1762 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1763 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1764 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1765 chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull
1768 const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix
1769 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1770 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1771 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon,
1772 chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon,
1773 chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull
1776 const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified
1777 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1778 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1779 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1780 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1781 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1782 chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chLatin_d, chNull
1785 const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri
1786 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1787 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1788 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1789 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1790 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1791 chLatin_u, chLatin_r, chLatin_i, chNull
1794 const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic
1795 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1796 chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1797 chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1798 chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash,
1799 chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon,
1800 chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull