X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml2%2Fcore%2Fimpl%2FAssertions20Impl.cpp;h=e472d6dd793ff7b2b6b1c0c6079c1c77a29b7745;hb=c94a8ec50180f280a81259fa13a23eb3a45e087f;hp=4672495562a08a1db2dd344ca594d6b67113a728;hpb=2d83f606e0827389b04ab9854697eade6d0eeaa9;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml2/core/impl/Assertions20Impl.cpp b/saml/saml2/core/impl/Assertions20Impl.cpp index 4672495..e472d6d 100644 --- a/saml/saml2/core/impl/Assertions20Impl.cpp +++ b/saml/saml2/core/impl/Assertions20Impl.cpp @@ -1,49 +1,60 @@ -/* - * Copyright 2001-2006 Internet2 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at +/** + * Licensed to the University Corporation for Advanced Internet + * Development, Inc. (UCAID) under one or more contributor license + * agreements. See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + * + * UCAID licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the + * License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. */ /** * Assertions20Impl.cpp - * - * Implementation classes for SAML 2.0 Assertions schema + * + * Implementation classes for SAML 2.0 Assertions schema. */ #include "internal.h" #include "exceptions.h" #include "saml/encryption/EncryptedKeyResolver.h" #include "saml2/core/Assertions.h" +#include "signature/ContentReference.h" -#include #include -#include #include -#include #include #include #include +#include +#include +#include #include #include #include using namespace opensaml::saml2; -using namespace opensaml; using namespace xmlencryption; using namespace xmlsignature; using namespace xmltooling; using namespace std; +using xmlconstants::XSI_NS; +using xmlconstants::XMLSIG_NS; +using xmlconstants::XMLENC_NS; +using xmlconstants::XML_BOOL_NULL; +using samlconstants::SAML20_NS; +using samlconstants::SAML20_DELEGATION_CONDITION_NS; + #if defined (_MSC_VER) #pragma warning( push ) @@ -52,7 +63,7 @@ using namespace std; namespace opensaml { namespace saml2 { - + DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef); DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef); DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience); @@ -62,20 +73,19 @@ namespace opensaml { class SAML_DLLLOCAL NameIDTypeImpl : public virtual NameIDType, public AbstractSimpleElement, - public AbstractChildlessElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller { void init() { - m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=NULL; + m_Format=m_SPProvidedID=m_NameQualifier=m_SPNameQualifier=nullptr; } - + protected: NameIDTypeImpl() { init(); } - + public: virtual ~NameIDTypeImpl() { XMLString::release(&m_NameQualifier); @@ -83,41 +93,43 @@ namespace opensaml { XMLString::release(&m_Format); XMLString::release(&m_SPProvidedID); } - - NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + NameIDTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - + NameIDTypeImpl(const NameIDTypeImpl& src) : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { init(); + } + + void _clone(const NameIDTypeImpl& src) { setNameQualifier(src.getNameQualifier()); setSPNameQualifier(src.getSPNameQualifier()); setFormat(src.getFormat()); setSPProvidedID(src.getSPProvidedID()); } - - IMPL_XMLOBJECT_CLONE(NameIDType); + + IMPL_XMLOBJECT_CLONE_EX(NameIDType); IMPL_STRING_ATTRIB(NameQualifier); IMPL_STRING_ATTRIB(SPNameQualifier); IMPL_STRING_ATTRIB(Format); IMPL_STRING_ATTRIB(SPProvidedID); - IMPL_XMLOBJECT_CONTENT; - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL); - MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL); - MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL); - MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL); + MARSHALL_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,nullptr); + MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,nullptr); + MARSHALL_STRING_ATTRIB(Format,FORMAT,nullptr); + MARSHALL_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,nullptr); } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,NULL); - PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL); - PROC_STRING_ATTRIB(Format,FORMAT,NULL); - PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,NULL); + PROC_STRING_ATTRIB(NameQualifier,NAMEQUALIFIER,nullptr); + PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,nullptr); + PROC_STRING_ATTRIB(Format,FORMAT,nullptr); + PROC_STRING_ATTRIB(SPProvidedID,SPPROVIDEDID,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -126,34 +138,32 @@ namespace opensaml { { public: virtual ~NameIDImpl() {} - - NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + NameIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} - - NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {} - - IMPL_XMLOBJECT_CLONE(NameID); - NameIDType* cloneNameIDType() const { - return new NameIDImpl(*this); + + NameIDImpl(const NameIDImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) { } + + IMPL_XMLOBJECT_CLONE_EX(NameID); }; class SAML_DLLLOCAL IssuerImpl : public virtual Issuer, public NameIDTypeImpl { public: virtual ~IssuerImpl() {} - - IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + IssuerImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} - - IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) {} - - IMPL_XMLOBJECT_CLONE(Issuer); - NameIDType* cloneNameIDType() const { - return new IssuerImpl(*this); + + IssuerImpl(const IssuerImpl& src) : AbstractXMLObject(src), NameIDTypeImpl(src) { } + + IMPL_XMLOBJECT_CLONE_EX(Issuer); }; + //TODO unit test for this + // - need to test encryption/decryption too, or already done in xmltooling ? class SAML_DLLLOCAL EncryptedElementTypeImpl : public virtual EncryptedElementType, public AbstractComplexElement, public AbstractDOMCachingXMLObject, @@ -161,63 +171,47 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_EncryptedData=NULL; - m_children.push_back(NULL); + m_EncryptedData=nullptr; + m_children.push_back(nullptr); m_pos_EncryptedData=m_children.begin(); } - + protected: EncryptedElementTypeImpl() { init(); } - + public: virtual ~EncryptedElementTypeImpl() {} - - EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + EncryptedElementTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - + EncryptedElementTypeImpl(const EncryptedElementTypeImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); + } + + void _clone(const EncryptedElementTypeImpl& src) { if (src.getEncryptedData()) setEncryptedData(src.getEncryptedData()->cloneEncryptedData()); - VectorOf(EncryptedKey) v=getEncryptedKeys(); for (vector::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) { if (*i) { - v.push_back((*i)->cloneEncryptedKey()); - } - } - } - - XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const - { - if (!m_EncryptedData) - throw DecryptionException("No encrypted data present."); - Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient)); - DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData); - if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) { - DOMNode* plaintext=frag->getFirstChild(); - if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) { - auto_ptr ret(XMLObjectBuilder::buildOneFromElement(static_cast(plaintext))); - ret->releaseThisAndChildrenDOM(); - return ret.release(); + getEncryptedKeys().push_back((*i)->cloneEncryptedKey()); } } - frag->release(); - throw DecryptionException("Decryption did not result in a single element."); } - - IMPL_XMLOBJECT_CLONE(EncryptedElementType); + + IMPL_XMLOBJECT_CLONE_EX(EncryptedElementType); IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption); IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false); - PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false); + PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false); + PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -226,16 +220,28 @@ namespace opensaml { { public: virtual ~EncryptedIDImpl() {} - - EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + EncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} - - EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {} - - IMPL_XMLOBJECT_CLONE(EncryptedID); - EncryptedElementType* cloneEncryptedElementType() const { - return new EncryptedIDImpl(*this); + + EncryptedIDImpl(const EncryptedIDImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) { } + + IMPL_XMLOBJECT_CLONE_EX(EncryptedID); + }; + + class SAML_DLLLOCAL ConditionImpl : public virtual Condition, public AnyElementImpl + { + public: + virtual ~ConditionImpl() {} + + ConditionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + } + + ConditionImpl(const ConditionImpl& src) : AbstractXMLObject(src), AnyElementImpl(src) {} + + IMPL_XMLOBJECT_CLONE(Condition); }; class SAML_DLLLOCAL AudienceRestrictionImpl : public virtual AudienceRestriction, @@ -246,53 +252,48 @@ namespace opensaml { { public: virtual ~AudienceRestrictionImpl() {} - - AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AudienceRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - AudienceRestrictionImpl(const AudienceRestrictionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { - VectorOf(Audience) v=getAudiences(); + + AudienceRestrictionImpl(const AudienceRestrictionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (vector::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) { if (*i) { - v.push_back((*i)->cloneAudience()); + getAudiences().push_back((*i)->cloneAudience()); } } } - - IMPL_XMLOBJECT_CLONE(AudienceRestriction); - Condition* cloneCondition() const { - return cloneAudienceRestriction(); - } + + IMPL_XMLOBJECT_CLONE2(AudienceRestriction,Condition); IMPL_TYPED_CHILDREN(Audience,m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Audience,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; class SAML_DLLLOCAL OneTimeUseImpl : public virtual OneTimeUse, - public AbstractChildlessElement, + public AbstractSimpleElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller { public: virtual ~OneTimeUseImpl() {} - - OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + OneTimeUseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - OneTimeUseImpl(const OneTimeUseImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { - } - - IMPL_XMLOBJECT_CLONE(OneTimeUse); - Condition* cloneCondition() const { - return cloneOneTimeUse(); + + OneTimeUseImpl(const OneTimeUseImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { } + + IMPL_XMLOBJECT_CLONE2(OneTimeUse,Condition); }; class SAML_DLLLOCAL ProxyRestrictionImpl : public virtual ProxyRestriction, @@ -305,45 +306,145 @@ namespace opensaml { virtual ~ProxyRestrictionImpl() { XMLString::release(&m_Count); } - - ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType) { - m_Count=NULL; + + ProxyRestrictionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Count(nullptr) { } - - ProxyRestrictionImpl(const ProxyRestrictionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + ProxyRestrictionImpl(const ProxyRestrictionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src), m_Count(nullptr) { setCount(src.m_Count); - VectorOf(Audience) v=getAudiences(); for (vector::const_iterator i=src.m_Audiences.begin(); i!=src.m_Audiences.end(); i++) { if (*i) { - v.push_back((*i)->cloneAudience()); + getAudiences().push_back((*i)->cloneAudience()); } } } - - IMPL_XMLOBJECT_CLONE(ProxyRestriction); - Condition* cloneCondition() const { - return cloneProxyRestriction(); - } + + IMPL_XMLOBJECT_CLONE2(ProxyRestriction,Condition); IMPL_TYPED_CHILDREN(Audience,m_children.end()); IMPL_INTEGER_ATTRIB(Count); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_INTEGER_ATTRIB(Count,COUNT,NULL); + MARSHALL_INTEGER_ATTRIB(Count,COUNT,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Audience,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Audience,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } void processAttribute(const DOMAttr* attribute) { - PROC_INTEGER_ATTRIB(Count,COUNT,NULL); + PROC_INTEGER_ATTRIB(Count,COUNT,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; + class SAML_DLLLOCAL DelegateImpl : public virtual Delegate, + public AbstractComplexElement, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller + { + void init() { + m_ConfirmationMethod=nullptr; + m_DelegationInstant=nullptr; + m_BaseID=nullptr; + m_NameID=nullptr; + m_EncryptedID=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_pos_BaseID=m_children.begin(); + m_pos_NameID=m_pos_BaseID; + ++m_pos_NameID; + m_pos_EncryptedID=m_pos_NameID; + ++m_pos_EncryptedID; + } + + public: + virtual ~DelegateImpl() { + XMLString::release(&m_ConfirmationMethod); + delete m_DelegationInstant; + } + + DelegateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + init(); + } + + DelegateImpl(const DelegateImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { + init(); + setConfirmationMethod(src.getConfirmationMethod()); + setDelegationInstant(src.getDelegationInstant()); + if (src.getBaseID()) + setBaseID(src.getBaseID()->cloneBaseID()); + if (src.getNameID()) + setNameID(src.getNameID()->cloneNameID()); + if (src.getEncryptedID()) + setEncryptedID(src.getEncryptedID()->cloneEncryptedID()); + } + + IMPL_XMLOBJECT_CLONE(Delegate); + IMPL_STRING_ATTRIB(ConfirmationMethod); + IMPL_DATETIME_ATTRIB(DelegationInstant,0); + IMPL_TYPED_CHILD(NameID); + IMPL_TYPED_CHILD(BaseID); + IMPL_TYPED_CHILD(EncryptedID); + + protected: + void marshallAttributes(DOMElement* domElement) const { + MARSHALL_STRING_ATTRIB(ConfirmationMethod,CONFIRMATIONMETHOD,nullptr); + MARSHALL_DATETIME_ATTRIB(DelegationInstant,DELEGATIONINSTANT,nullptr); + } + + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILD(BaseID,SAML20_NS,false); + PROC_TYPED_CHILD(NameID,SAML20_NS,false); + PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false); + AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); + } + + void processAttribute(const DOMAttr* attribute) { + PROC_STRING_ATTRIB(ConfirmationMethod,CONFIRMATIONMETHOD,nullptr); + PROC_DATETIME_ATTRIB(DelegationInstant,DELEGATIONINSTANT,nullptr); + AbstractXMLObjectUnmarshaller::processAttribute(attribute); + } + }; + + class SAML_DLLLOCAL DelegationRestrictionTypeImpl : public virtual DelegationRestrictionType, + public AbstractComplexElement, + public AbstractDOMCachingXMLObject, + public AbstractXMLObjectMarshaller, + public AbstractXMLObjectUnmarshaller + { + public: + virtual ~DelegationRestrictionTypeImpl() {} + + DelegationRestrictionTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + } + + DelegationRestrictionTypeImpl(const DelegationRestrictionTypeImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { + for (vector::const_iterator i=src.m_Delegates.begin(); i!=src.m_Delegates.end(); i++) { + if (*i) { + getDelegates().push_back((*i)->cloneDelegate()); + } + } + } + + IMPL_XMLOBJECT_CLONE2(DelegationRestrictionType,Condition); + IMPL_TYPED_CHILDREN(Delegate,m_children.end()); + + protected: + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { + PROC_TYPED_CHILDREN(Delegate,SAML20_DELEGATION_CONDITION_NS,false); + AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); + } + }; class SAML_DLLLOCAL ConditionsImpl : public virtual Conditions, public AbstractComplexElement, @@ -352,20 +453,22 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_NotBefore=m_NotOnOrAfter=NULL; + m_NotBefore=m_NotOnOrAfter=nullptr; } + public: virtual ~ConditionsImpl() { delete m_NotBefore; delete m_NotOnOrAfter; } - - ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + ConditionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - ConditionsImpl(const ConditionsImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + ConditionsImpl(const ConditionsImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setNotBefore(src.getNotBefore()); setNotOnOrAfter(src.getNotOnOrAfter()); @@ -377,13 +480,13 @@ namespace opensaml { getAudienceRestrictions().push_back(arc->cloneAudienceRestriction()); continue; } - + OneTimeUse* dncc=dynamic_cast(*i); if (dncc) { getOneTimeUses().push_back(dncc->cloneOneTimeUse()); continue; } - + ProxyRestriction* prc=dynamic_cast(*i); if (prc) { getProxyRestrictions().push_back(prc->cloneProxyRestriction()); @@ -398,7 +501,7 @@ namespace opensaml { } } } - + IMPL_XMLOBJECT_CLONE(Conditions); IMPL_DATETIME_ATTRIB(NotBefore,0); IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX); @@ -406,66 +509,116 @@ namespace opensaml { IMPL_TYPED_CHILDREN(OneTimeUse,m_children.end()); IMPL_TYPED_CHILDREN(ProxyRestriction, m_children.end()); IMPL_TYPED_CHILDREN(Condition,m_children.end()); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL); - MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL); + MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,nullptr); + MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr); } - + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AudienceRestriction,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(OneTimeUse,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(ProxyRestriction,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Condition,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(AudienceRestriction,SAML20_NS,false); + PROC_TYPED_CHILDREN(OneTimeUse,SAML20_NS,false); + PROC_TYPED_CHILDREN(ProxyRestriction,SAML20_NS,false); + PROC_TYPED_CHILDREN(Condition,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } - + void processAttribute(const DOMAttr* attribute) { - PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL); - PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL); + PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,nullptr); + PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; - class SAML_DLLLOCAL SubjectConfirmationDataImpl : public virtual SubjectConfirmationData, public AnyElementImpl + class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType, public virtual AbstractXMLObject { void init() { - m_NotBefore=m_NotOnOrAfter=NULL; - m_Recipient=m_InResponseTo=m_Address=NULL; + m_NotBefore=m_NotOnOrAfter=nullptr; + m_Recipient=m_InResponseTo=m_Address=nullptr; } + + protected: + SubjectConfirmationDataTypeImpl() { + init(); + } + public: - virtual ~SubjectConfirmationDataImpl() { + virtual ~SubjectConfirmationDataTypeImpl() { delete m_NotBefore; delete m_NotOnOrAfter; XMLString::release(&m_Recipient); XMLString::release(&m_InResponseTo); XMLString::release(&m_Address); } - - SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + SubjectConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src) : AnyElementImpl(src) { + + SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractXMLObject(src) { init(); + } + + void _clone(const SubjectConfirmationDataTypeImpl& src) { setNotBefore(src.getNotBefore()); setNotOnOrAfter(src.getNotOnOrAfter()); setRecipient(src.getRecipient()); setInResponseTo(src.getInResponseTo()); setAddress(src.getAddress()); } - - IMPL_XMLOBJECT_CLONE(SubjectConfirmationData); + + SubjectConfirmationDataType* cloneSubjectConfirmationDataType() const { + return dynamic_cast(clone()); + } + IMPL_DATETIME_ATTRIB(NotBefore,0); IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX); IMPL_STRING_ATTRIB(Recipient); IMPL_STRING_ATTRIB(InResponseTo); IMPL_STRING_ATTRIB(Address); - + + protected: + void marshallAttributes(DOMElement* domElement) const { + MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,nullptr); + MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr); + MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,nullptr); + MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,nullptr); + MARSHALL_STRING_ATTRIB(Address,ADDRESS,nullptr); + } + + void processAttribute(const DOMAttr* attribute) { + PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,nullptr); + PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr); + PROC_STRING_ATTRIB(Recipient,RECIPIENT,nullptr); + PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,nullptr); + PROC_STRING_ATTRIB(Address,ADDRESS,nullptr); + } + }; + + class SAML_DLLLOCAL SubjectConfirmationDataImpl : public SubjectConfirmationData, + public SubjectConfirmationDataTypeImpl, public AnyElementImpl + { public: - void setAttribute(QName& qualifiedName, const XMLCh* value) { + virtual ~SubjectConfirmationDataImpl() {} + + SubjectConfirmationDataImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + } + + SubjectConfirmationDataImpl(const SubjectConfirmationDataImpl& src) + : AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AnyElementImpl(src) { + } + + void _clone(const SubjectConfirmationDataImpl& src) { + SubjectConfirmationDataTypeImpl::_clone(src); + AnyElementImpl::_clone(src); + } + + IMPL_XMLOBJECT_CLONE_EX(SubjectConfirmationData); + + void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) { setNotBefore(value); @@ -488,73 +641,59 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL); - MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL); - MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL); - MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL); - MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL); + SubjectConfirmationDataTypeImpl::marshallAttributes(domElement); AnyElementImpl::marshallAttributes(domElement); } - - // The processAttributes hook is handled by AnyElementImpl + + void processAttribute(const DOMAttr* attribute) { + PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,nullptr); + PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,nullptr); + PROC_STRING_ATTRIB(Recipient,RECIPIENT,nullptr); + PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,nullptr); + PROC_STRING_ATTRIB(Address,ADDRESS,nullptr); + AnyElementImpl::processAttribute(attribute); + } }; class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType, + public SubjectConfirmationDataTypeImpl, public AbstractComplexElement, public AbstractAttributeExtensibleXMLObject, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller { - void init() { - m_NotBefore=m_NotOnOrAfter=NULL; - m_Recipient=m_InResponseTo=m_Address=NULL; - } public: - virtual ~KeyInfoConfirmationDataTypeImpl() { - delete m_NotBefore; - delete m_NotOnOrAfter; - XMLString::release(&m_Recipient); - XMLString::release(&m_InResponseTo); - XMLString::release(&m_Address); - } - - KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType) { - init(); + virtual ~KeyInfoConfirmationDataTypeImpl() {} + + KeyInfoConfirmationDataTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - + KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src) - : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { - init(); - setNotBefore(src.getNotBefore()); - setNotOnOrAfter(src.getNotOnOrAfter()); - setRecipient(src.getRecipient()); - setInResponseTo(src.getInResponseTo()); - setAddress(src.getAddress()); - VectorOf(KeyInfo) v=getKeyInfos(); - for (vector::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); i++) { + : AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AbstractComplexElement(src), + AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { + } + + void _clone(const KeyInfoConfirmationDataTypeImpl& src) { + SubjectConfirmationDataTypeImpl::_clone(src); + for (vector::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i) { if (*i) { - v.push_back((*i)->cloneKeyInfo()); + getKeyInfos().push_back((*i)->cloneKeyInfo()); } } } - - IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType); - IMPL_DATETIME_ATTRIB(NotBefore,0); - IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX); - IMPL_STRING_ATTRIB(Recipient); - IMPL_STRING_ATTRIB(InResponseTo); - IMPL_STRING_ATTRIB(Address); + + IMPL_XMLOBJECT_CLONE_EX(KeyInfoConfirmationDataType); IMPL_TYPED_CHILDREN(KeyInfo,m_children.end()); - + public: - void setAttribute(QName& qualifiedName, const XMLCh* value) { + void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NOTBEFORE_ATTRIB_NAME)) { setNotBefore(value); @@ -577,35 +716,22 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL); - MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL); - MARSHALL_STRING_ATTRIB(Recipient,RECIPIENT,NULL); - MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL); - MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL); - - // Take care of wildcard. - for (map::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) { - DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart()); - if (i->first.hasPrefix()) - attr->setPrefix(i->first.getPrefix()); - attr->setNodeValue(i->second); - domElement->setAttributeNode(attr); - } + SubjectConfirmationDataTypeImpl::marshallAttributes(domElement); + marshallExtensionAttributes(domElement); } - + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(KeyInfo,XMLConstants::XMLSIG_NS,false); + PROC_TYPED_CHILDREN(KeyInfo,XMLSIG_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } void processAttribute(const DOMAttr* attribute) { - QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix()); - setAttribute(q,attribute->getNodeValue()); + unmarshallExtensionAttribute(attribute); } }; @@ -616,16 +742,15 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_Method=NULL; - m_BaseID=NULL; - m_NameID=NULL; - m_EncryptedID=NULL; - m_SubjectConfirmationData=NULL; - m_KeyInfoConfirmationDataType=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_Method=nullptr; + m_BaseID=nullptr; + m_NameID=nullptr; + m_EncryptedID=nullptr; + m_SubjectConfirmationData=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_BaseID=m_children.begin(); m_pos_NameID=m_pos_BaseID; ++m_pos_NameID; @@ -633,18 +758,20 @@ namespace opensaml { ++m_pos_EncryptedID; m_pos_SubjectConfirmationData=m_pos_EncryptedID; ++m_pos_SubjectConfirmationData; - m_pos_KeyInfoConfirmationDataType=m_pos_SubjectConfirmationData; - ++m_pos_KeyInfoConfirmationDataType; } + public: - virtual ~SubjectConfirmationImpl() {} - - SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + virtual ~SubjectConfirmationImpl() { + XMLString::release(&m_Method); + } + + SubjectConfirmationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - SubjectConfirmationImpl(const SubjectConfirmationImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + SubjectConfirmationImpl(const SubjectConfirmationImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setMethod(src.getMethod()); if (src.getBaseID()) @@ -655,34 +782,30 @@ namespace opensaml { setEncryptedID(src.getEncryptedID()->cloneEncryptedID()); if (src.getSubjectConfirmationData()) setSubjectConfirmationData(src.getSubjectConfirmationData()->clone()); - if (src.getKeyInfoConfirmationDataType()) - setKeyInfoConfirmationDataType(src.getKeyInfoConfirmationDataType()->cloneKeyInfoConfirmationDataType()); } - + IMPL_XMLOBJECT_CLONE(SubjectConfirmation); IMPL_STRING_ATTRIB(Method); IMPL_TYPED_CHILD(BaseID); IMPL_TYPED_CHILD(NameID); IMPL_TYPED_CHILD(EncryptedID); IMPL_XMLOBJECT_CHILD(SubjectConfirmationData); - IMPL_TYPED_CHILD(KeyInfoConfirmationDataType); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Method,METHOD,NULL); + MARSHALL_STRING_ATTRIB(Method,METHOD,nullptr); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false); - PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAMLConstants::SAML20_NS); - PROC_TYPED_CHILD(KeyInfoConfirmationDataType,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(BaseID,SAML20_NS,false); + PROC_TYPED_CHILD(NameID,SAML20_NS,false); + PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false); + PROC_XMLOBJECT_CHILD(SubjectConfirmationData,SAML20_NS); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Method,METHOD,NULL); + PROC_STRING_ATTRIB(Method,METHOD,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -694,27 +817,29 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_BaseID=NULL; - m_NameID=NULL; - m_EncryptedID=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_BaseID=nullptr; + m_NameID=nullptr; + m_EncryptedID=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_BaseID=m_children.begin(); m_pos_NameID=m_pos_BaseID; ++m_pos_NameID; m_pos_EncryptedID=m_pos_NameID; ++m_pos_EncryptedID; } + public: virtual ~SubjectImpl() {} - - SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + SubjectImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - SubjectImpl(const SubjectImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + SubjectImpl(const SubjectImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); if (src.getBaseID()) setBaseID(src.getBaseID()->cloneBaseID()); @@ -722,86 +847,102 @@ namespace opensaml { setNameID(src.getNameID()->cloneNameID()); if (src.getEncryptedID()) setEncryptedID(src.getEncryptedID()->cloneEncryptedID()); - VectorOf(SubjectConfirmation) v=getSubjectConfirmations(); for (vector::const_iterator i=src.m_SubjectConfirmations.begin(); i!=src.m_SubjectConfirmations.end(); i++) { if (*i) { - v.push_back((*i)->cloneSubjectConfirmation()); + getSubjectConfirmations().push_back((*i)->cloneSubjectConfirmation()); } } } - + IMPL_XMLOBJECT_CLONE(Subject); IMPL_TYPED_CHILD(NameID); IMPL_TYPED_CHILD(BaseID); IMPL_TYPED_CHILD(EncryptedID); IMPL_TYPED_CHILDREN(SubjectConfirmation,m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(BaseID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(NameID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(EncryptedID,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(SubjectConfirmation,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(BaseID,SAML20_NS,false); + PROC_TYPED_CHILD(NameID,SAML20_NS,false); + PROC_TYPED_CHILD(EncryptedID,SAML20_NS,false); + PROC_TYPED_CHILDREN(SubjectConfirmation,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; class SAML_DLLLOCAL SubjectLocalityImpl : public virtual SubjectLocality, - public AbstractChildlessElement, + public AbstractSimpleElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller { void init() { - m_Address=m_DNSName=NULL; + m_Address=m_DNSName=nullptr; } + public: virtual ~SubjectLocalityImpl() { XMLString::release(&m_Address); XMLString::release(&m_DNSName); } - - SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + SubjectLocalityImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - SubjectLocalityImpl(const SubjectLocalityImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + SubjectLocalityImpl(const SubjectLocalityImpl& src) + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { init(); setAddress(src.getAddress()); setDNSName(src.getDNSName()); } - + IMPL_XMLOBJECT_CLONE(SubjectLocality); IMPL_STRING_ATTRIB(Address); IMPL_STRING_ATTRIB(DNSName); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Address,ADDRESS,NULL); - MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,NULL); + MARSHALL_STRING_ATTRIB(Address,ADDRESS,nullptr); + MARSHALL_STRING_ATTRIB(DNSName,DNSNAME,nullptr); } - + void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Address,ADDRESS,NULL); - PROC_STRING_ATTRIB(DNSName,DNSNAME,NULL); + PROC_STRING_ATTRIB(Address,ADDRESS,nullptr); + PROC_STRING_ATTRIB(DNSName,DNSNAME,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; + class SAML_DLLLOCAL StatementImpl : public virtual Statement, public AnyElementImpl + { + public: + virtual ~StatementImpl() {} + + StatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType) { + } + + StatementImpl(const StatementImpl& src) : AbstractXMLObject(src), AnyElementImpl(src) {} + + IMPL_XMLOBJECT_CLONE_EX(Statement); + }; + + //TODO need unit test for this class SAML_DLLLOCAL AuthnContextDeclImpl : public virtual AuthnContextDecl, public AnyElementImpl { public: virtual ~AuthnContextDeclImpl() {} - - AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AuthnContextDeclImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AnyElementImpl(src) { + + AuthnContextDeclImpl(const AuthnContextDeclImpl& src) : AbstractXMLObject(src), AnyElementImpl(src) { } - - IMPL_XMLOBJECT_CLONE(AuthnContextDecl); + + IMPL_XMLOBJECT_CLONE_EX(AuthnContextDecl); }; class SAML_DLLLOCAL AuthnContextImpl : public virtual AuthnContext, @@ -811,27 +952,29 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_AuthnContextClassRef=NULL; - m_AuthnContextDecl=NULL; - m_AuthnContextDeclRef=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_AuthnContextClassRef=nullptr; + m_AuthnContextDecl=nullptr; + m_AuthnContextDeclRef=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_AuthnContextClassRef=m_children.begin(); m_pos_AuthnContextDecl=m_pos_AuthnContextClassRef; ++m_pos_AuthnContextDecl; m_pos_AuthnContextDeclRef=m_pos_AuthnContextDecl; ++m_pos_AuthnContextDeclRef; } + public: virtual ~AuthnContextImpl() {} - - AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - AuthnContextImpl(const AuthnContextImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + AuthnContextImpl(const AuthnContextImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); if (src.getAuthnContextClassRef()) setAuthnContextClassRef(src.getAuthnContextClassRef()->cloneAuthnContextClassRef()); @@ -839,26 +982,25 @@ namespace opensaml { setAuthnContextDecl(src.getAuthnContextDecl()->clone()); if (src.getAuthnContextDeclRef()) setAuthnContextDeclRef(src.getAuthnContextDeclRef()->cloneAuthnContextDeclRef()); - VectorOf(AuthenticatingAuthority) v=getAuthenticatingAuthoritys(); for (vector::const_iterator i=src.m_AuthenticatingAuthoritys.begin(); i!=src.m_AuthenticatingAuthoritys.end(); i++) { if (*i) { - v.push_back((*i)->cloneAuthenticatingAuthority()); + getAuthenticatingAuthoritys().push_back((*i)->cloneAuthenticatingAuthority()); } } } - + IMPL_XMLOBJECT_CLONE(AuthnContext); IMPL_TYPED_CHILD(AuthnContextClassRef); IMPL_XMLOBJECT_CHILD(AuthnContextDecl); IMPL_TYPED_CHILD(AuthnContextDeclRef); IMPL_TYPED_CHILDREN(AuthenticatingAuthority,m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(AuthnContextClassRef,SAMLConstants::SAML20_NS,false); - PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAMLConstants::SAML20_NS); - PROC_TYPED_CHILD(AuthnContextDeclRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(AuthnContextClassRef,SAML20_NS,false); + PROC_XMLOBJECT_CHILD(AuthnContextDecl,SAML20_NS); + PROC_TYPED_CHILD(AuthnContextDeclRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthenticatingAuthority,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -870,30 +1012,32 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_AuthnInstant=NULL; - m_SessionIndex=NULL; - m_SessionNotOnOrAfter=NULL; - m_SubjectLocality=NULL; - m_AuthnContext=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); + m_AuthnInstant=nullptr; + m_SessionIndex=nullptr; + m_SessionNotOnOrAfter=nullptr; + m_SubjectLocality=nullptr; + m_AuthnContext=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_SubjectLocality=m_children.begin(); m_pos_AuthnContext=m_pos_SubjectLocality; ++m_pos_AuthnContext; } + public: virtual ~AuthnStatementImpl() { delete m_AuthnInstant; XMLString::release(&m_SessionIndex); delete m_SessionNotOnOrAfter; } - - AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AuthnStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - AuthnStatementImpl(const AuthnStatementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + AuthnStatementImpl(const AuthnStatementImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setAuthnInstant(src.getAuthnInstant()); setSessionIndex(src.getSessionIndex()); @@ -903,41 +1047,37 @@ namespace opensaml { if (src.getAuthnContext()) setAuthnContext(src.getAuthnContext()->cloneAuthnContext()); } - - IMPL_XMLOBJECT_CLONE(AuthnStatement); - Statement* cloneStatement() const { - return cloneAuthnStatement(); - } + + IMPL_XMLOBJECT_CLONE2(AuthnStatement,Statement); IMPL_DATETIME_ATTRIB(AuthnInstant,0); IMPL_STRING_ATTRIB(SessionIndex); IMPL_DATETIME_ATTRIB(SessionNotOnOrAfter,SAMLTIME_MAX); IMPL_TYPED_CHILD(SubjectLocality); IMPL_TYPED_CHILD(AuthnContext); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL); - MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL); - MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL); + MARSHALL_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,nullptr); + MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,nullptr); + MARSHALL_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,nullptr); } - + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(SubjectLocality,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(AuthnContext,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(SubjectLocality,SAML20_NS,false); + PROC_TYPED_CHILD(AuthnContext,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } - + void processAttribute(const DOMAttr* attribute) { - PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,NULL); - PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL); - PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,NULL); + PROC_DATETIME_ATTRIB(AuthnInstant,AUTHNINSTANT,nullptr); + PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,nullptr); + PROC_DATETIME_ATTRIB(SessionNotOnOrAfter,SESSIONNOTONORAFTER,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; class SAML_DLLLOCAL ActionImpl : public virtual Action, public AbstractSimpleElement, - public AbstractChildlessElement, public AbstractDOMCachingXMLObject, public AbstractXMLObjectMarshaller, public AbstractXMLObjectUnmarshaller @@ -946,27 +1086,26 @@ namespace opensaml { virtual ~ActionImpl() { XMLString::release(&m_Namespace); } - - ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) - : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(NULL) { + + ActionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) + : AbstractXMLObject(nsURI, localName, prefix, schemaType), m_Namespace(nullptr) { } - + ActionImpl(const ActionImpl& src) - : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src), m_Namespace(nullptr) { setNamespace(src.getNamespace()); } - + IMPL_XMLOBJECT_CLONE(Action); IMPL_STRING_ATTRIB(Namespace); - IMPL_XMLOBJECT_CONTENT; - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,NULL); + MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,nullptr); } void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL); + PROC_STRING_ATTRIB(Namespace,NAMESPACE,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -979,12 +1118,13 @@ namespace opensaml { { public: virtual ~EvidenceImpl() {} - - EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + EvidenceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - EvidenceImpl(const EvidenceImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + EvidenceImpl(const EvidenceImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { AssertionIDRef* ref=dynamic_cast(*i); @@ -992,7 +1132,7 @@ namespace opensaml { getAssertionIDRefs().push_back(ref->cloneAssertionIDRef()); continue; } - + AssertionURIRef* uri=dynamic_cast(*i); if (uri) { getAssertionURIRefs().push_back(uri->cloneAssertionURIRef()); @@ -1004,7 +1144,7 @@ namespace opensaml { getAssertions().push_back(assertion->cloneAssertion()); continue; } - + EncryptedAssertion* enc=dynamic_cast(*i); if (enc) { getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion()); @@ -1013,19 +1153,19 @@ namespace opensaml { } } } - + IMPL_XMLOBJECT_CLONE(Evidence); IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end()); IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end()); IMPL_TYPED_CHILDREN(Assertion,m_children.end()); IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -1037,62 +1177,59 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_Resource=NULL; - m_Decision=NULL; - m_Evidence=NULL; - m_children.push_back(NULL); + m_Resource=nullptr; + m_Decision=nullptr; + m_Evidence=nullptr; + m_children.push_back(nullptr); m_pos_Evidence=m_children.begin(); } + public: virtual ~AuthzDecisionStatementImpl() { XMLString::release(&m_Resource); XMLString::release(&m_Decision); } - - AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AuthzDecisionStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - + AuthzDecisionStatementImpl(const AuthzDecisionStatementImpl& src) - : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setResource(src.getResource()); setDecision(src.getDecision()); if (src.getEvidence()) setEvidence(src.getEvidence()->cloneEvidence()); - VectorOf(Action) v=getActions(); for (vector::const_iterator i=src.m_Actions.begin(); i!=src.m_Actions.end(); i++) { if (*i) { - v.push_back((*i)->cloneAction()); + getActions().push_back((*i)->cloneAction()); } } } - - IMPL_XMLOBJECT_CLONE(AuthzDecisionStatement); - Statement* cloneStatement() const { - return cloneAuthzDecisionStatement(); - } + + IMPL_XMLOBJECT_CLONE2(AuthzDecisionStatement,Statement); IMPL_STRING_ATTRIB(Resource); IMPL_STRING_ATTRIB(Decision); IMPL_TYPED_CHILD(Evidence); IMPL_TYPED_CHILDREN(Action, m_pos_Evidence); - + protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL); - MARSHALL_STRING_ATTRIB(Decision,DECISION,NULL); + MARSHALL_STRING_ATTRIB(Resource,RESOURCE,nullptr); + MARSHALL_STRING_ATTRIB(Decision,DECISION,nullptr); } - + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Evidence,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Action,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(Evidence,SAML20_NS,false); + PROC_TYPED_CHILDREN(Action,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } - + void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Resource,RESOURCE,NULL); - PROC_STRING_ATTRIB(Decision,DECISION,NULL); + PROC_STRING_ATTRIB(Resource,RESOURCE,nullptr); + PROC_STRING_ATTRIB(Decision,DECISION,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -1101,15 +1238,15 @@ namespace opensaml { { public: virtual ~AttributeValueImpl() {} - - AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AttributeValueImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - AttributeValueImpl(const AttributeValueImpl& src) : AnyElementImpl(src) { + + AttributeValueImpl(const AttributeValueImpl& src) : AbstractXMLObject(src), AnyElementImpl(src) { } - - IMPL_XMLOBJECT_CLONE(AttributeValue); + + IMPL_XMLOBJECT_CLONE_EX(AttributeValue); }; @@ -1121,41 +1258,42 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_Name=m_NameFormat=m_FriendlyName=NULL; + m_Name=m_NameFormat=m_FriendlyName=nullptr; } + public: virtual ~AttributeImpl() { XMLString::release(&m_Name); XMLString::release(&m_NameFormat); XMLString::release(&m_FriendlyName); } - - AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - + AttributeImpl(const AttributeImpl& src) - : AbstractXMLObject(src), AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { + : AbstractXMLObject(src), AbstractComplexElement(src), + AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) { init(); setName(src.getName()); setNameFormat(src.getNameFormat()); setFriendlyName(src.getFriendlyName()); - VectorOf(XMLObject) v=getAttributeValues(); for (vector::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) { if (*i) { - v.push_back((*i)->clone()); + getAttributeValues().push_back((*i)->clone()); } } } - + IMPL_XMLOBJECT_CLONE(Attribute); IMPL_STRING_ATTRIB(Name); IMPL_STRING_ATTRIB(NameFormat); IMPL_STRING_ATTRIB(FriendlyName); IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end()); - - void setAttribute(QName& qualifiedName, const XMLCh* value) { + + void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) { if (!qualifiedName.hasNamespaceURI()) { if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) { setName(value); @@ -1170,23 +1308,15 @@ namespace opensaml { return; } } - AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value); + AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID); } protected: void marshallAttributes(DOMElement* domElement) const { - MARSHALL_STRING_ATTRIB(Name,NAME,NULL); - MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL); - MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL); - - // Take care of wildcard. - for (map::const_iterator i=m_attributeMap.begin(); i!=m_attributeMap.end(); i++) { - DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(i->first.getNamespaceURI(),i->first.getLocalPart()); - if (i->first.hasPrefix()) - attr->setPrefix(i->first.getPrefix()); - attr->setNodeValue(i->second); - domElement->setAttributeNode(attr); - } + MARSHALL_STRING_ATTRIB(Name,NAME,nullptr); + MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,nullptr); + MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,nullptr); + marshallExtensionAttributes(domElement); } void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { @@ -1194,25 +1324,22 @@ namespace opensaml { } void processAttribute(const DOMAttr* attribute) { - QName q(attribute->getNamespaceURI(),attribute->getLocalName(),attribute->getPrefix()); - setAttribute(q,attribute->getNodeValue()); + unmarshallExtensionAttribute(attribute); } }; + //TODO unit test for this class SAML_DLLLOCAL EncryptedAttributeImpl : public virtual EncryptedAttribute, public EncryptedElementTypeImpl { public: virtual ~EncryptedAttributeImpl() {} - - EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + EncryptedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} - + EncryptedAttributeImpl(const EncryptedAttributeImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {} - - IMPL_XMLOBJECT_CLONE(EncryptedAttribute); - EncryptedElementType* cloneEncryptedElementType() const { - return new EncryptedAttributeImpl(*this); - } + + IMPL_XMLOBJECT_CLONE_EX(EncryptedAttribute); }; class SAML_DLLLOCAL AttributeStatementImpl : public virtual AttributeStatement, @@ -1223,12 +1350,13 @@ namespace opensaml { { public: virtual ~AttributeStatementImpl() {} - - AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AttributeStatementImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - AttributeStatementImpl(const AttributeStatementImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + AttributeStatementImpl(const AttributeStatementImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { Attribute* attribute=dynamic_cast(*i); @@ -1236,7 +1364,7 @@ namespace opensaml { getAttributes().push_back(attribute->cloneAttribute()); continue; } - + EncryptedAttribute* enc=dynamic_cast(*i); if (enc) { getEncryptedAttributes().push_back(enc->cloneEncryptedAttribute()); @@ -1245,18 +1373,15 @@ namespace opensaml { } } } - - IMPL_XMLOBJECT_CLONE(AttributeStatement); - Statement* cloneStatement() const { - return cloneAttributeStatement(); - } + + IMPL_XMLOBJECT_CLONE2(AttributeStatement,Statement); IMPL_TYPED_CHILDREN(Attribute, m_children.end()); IMPL_TYPED_CHILDREN(EncryptedAttribute, m_children.end()); - + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(Attribute,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAttribute,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILDREN(Attribute,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAttribute,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; @@ -1269,12 +1394,13 @@ namespace opensaml { { public: virtual ~AdviceImpl() {} - - AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AdviceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { } - - AdviceImpl(const AdviceImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + AdviceImpl(const AdviceImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { for (list::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) { if (*i) { AssertionIDRef* ref=dynamic_cast(*i); @@ -1282,7 +1408,7 @@ namespace opensaml { getAssertionIDRefs().push_back(ref->cloneAssertionIDRef()); continue; } - + AssertionURIRef* uri=dynamic_cast(*i); if (uri) { getAssertionURIRefs().push_back(uri->cloneAssertionURIRef()); @@ -1294,57 +1420,57 @@ namespace opensaml { getAssertions().push_back(assertion->cloneAssertion()); continue; } - + EncryptedAssertion* enc=dynamic_cast(*i); if (enc) { getEncryptedAssertions().push_back(enc->cloneEncryptedAssertion()); continue; } - getOthers().push_back((*i)->clone()); + if (*i) { + getUnknownXMLObjects().push_back((*i)->clone()); + } } } } - + IMPL_XMLOBJECT_CLONE(Advice); IMPL_TYPED_CHILDREN(AssertionIDRef,m_children.end()); IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end()); IMPL_TYPED_CHILDREN(Assertion,m_children.end()); IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end()); - IMPL_XMLOBJECT_CHILDREN(Other,m_children.end()); - + IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end()); + protected: void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILDREN(AssertionIDRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AssertionURIRef,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(EncryptedAssertion,SAMLConstants::SAML20_NS,false); - + PROC_TYPED_CHILDREN(AssertionIDRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(AssertionURIRef,SAML20_NS,false); + PROC_TYPED_CHILDREN(Assertion,SAML20_NS,false); + PROC_TYPED_CHILDREN(EncryptedAssertion,SAML20_NS,false); + // Unknown child. const XMLCh* nsURI=root->getNamespaceURI(); - if (!XMLString::equals(nsURI,SAMLConstants::SAML20_NS) && nsURI && *nsURI) { - getOthers().push_back(childXMLObject); + if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) { + getUnknownXMLObjects().push_back(childXMLObject); return; } - + AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } }; + //TODO unit test for this class SAML_DLLLOCAL EncryptedAssertionImpl : public virtual EncryptedAssertion, public EncryptedElementTypeImpl { public: virtual ~EncryptedAssertionImpl() {} - - EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + EncryptedAssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) {} - + EncryptedAssertionImpl(const EncryptedAssertionImpl& src) : AbstractXMLObject(src), EncryptedElementTypeImpl(src) {} - - IMPL_XMLOBJECT_CLONE(EncryptedAssertion); - EncryptedElementType* cloneEncryptedElementType() const { - return new EncryptedAssertionImpl(*this); - } + + IMPL_XMLOBJECT_CLONE_EX(EncryptedAssertion); }; class SAML_DLLLOCAL AssertionImpl : public virtual Assertion, @@ -1354,19 +1480,19 @@ namespace opensaml { public AbstractXMLObjectUnmarshaller { void init() { - m_ID=NULL; - m_Version=NULL; - m_IssueInstant=NULL; - m_Issuer=NULL; - m_Signature=NULL; - m_Subject=NULL; - m_Conditions=NULL; - m_Advice=NULL; - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); - m_children.push_back(NULL); + m_ID=nullptr; + m_Version=nullptr; + m_IssueInstant=nullptr; + m_Issuer=nullptr; + m_Signature=nullptr; + m_Subject=nullptr; + m_Conditions=nullptr; + m_Advice=nullptr; + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); + m_children.push_back(nullptr); m_pos_Issuer=m_children.begin(); m_pos_Signature=m_pos_Issuer; ++m_pos_Signature; @@ -1377,19 +1503,21 @@ namespace opensaml { m_pos_Advice=m_pos_Conditions; ++m_pos_Advice; } + public: virtual ~AssertionImpl() { XMLString::release(&m_ID); XMLString::release(&m_Version); delete m_IssueInstant; } - - AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType) + + AssertionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType) : AbstractXMLObject(nsURI, localName, prefix, schemaType) { init(); } - - AssertionImpl(const AssertionImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) { + + AssertionImpl(const AssertionImpl& src) + : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) { init(); setVersion(src.getVersion()); setID(src.getID()); @@ -1423,7 +1551,7 @@ namespace opensaml { getAuthzDecisionStatements().push_back(authzst->cloneAuthzDecisionStatement()); continue; } - + Statement* st=dynamic_cast(*i); if (st) { getStatements().push_back(st->cloneStatement()); @@ -1432,10 +1560,6 @@ namespace opensaml { } } } - - const XMLCh* getId() const { - return getID(); - } //IMPL_TYPED_CHILD(Signature); // Need customized setter. @@ -1446,7 +1570,7 @@ namespace opensaml { Signature* getSignature() const { return m_Signature; } - + void setSignature(Signature* sig) { prepareForAssignment(m_Signature,sig); *m_pos_Signature=m_Signature=sig; @@ -1454,10 +1578,10 @@ namespace opensaml { if (m_Signature) m_Signature->setContentReference(new opensaml::ContentReference(*this)); } - + IMPL_XMLOBJECT_CLONE(Assertion); IMPL_STRING_ATTRIB(Version); - IMPL_STRING_ATTRIB(ID); + IMPL_ID_ATTRIB_EX(ID,ID,nullptr); IMPL_DATETIME_ATTRIB(IssueInstant,0); IMPL_TYPED_CHILD(Issuer); IMPL_TYPED_CHILD(Subject); @@ -1467,39 +1591,44 @@ namespace opensaml { IMPL_TYPED_CHILDREN(AuthnStatement, m_children.end()); IMPL_TYPED_CHILDREN(AttributeStatement, m_children.end()); IMPL_TYPED_CHILDREN(AuthzDecisionStatement, m_children.end()); - + protected: + void prepareForMarshalling() const { + if (m_Signature) + declareNonVisibleNamespaces(); + } + void marshallAttributes(DOMElement* domElement) const { if (!m_Version) const_cast(this)->m_Version=XMLString::transcode("2.0"); - MARSHALL_STRING_ATTRIB(Version,VER,NULL); + MARSHALL_STRING_ATTRIB(Version,VER,nullptr); if (!m_ID) const_cast(this)->m_ID=SAMLConfig::getConfig().generateIdentifier(); - MARSHALL_ID_ATTRIB(ID,ID,NULL); + MARSHALL_ID_ATTRIB(ID,ID,nullptr); if (!m_IssueInstant) { - const_cast(this)->m_IssueInstantEpoch=time(NULL); + const_cast(this)->m_IssueInstantEpoch=time(nullptr); const_cast(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch); } - MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL); + MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr); } - + void processChildElement(XMLObject* childXMLObject, const DOMElement* root) { - PROC_TYPED_CHILD(Issuer,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Signature,XMLConstants::XMLSIG_NS,false); - PROC_TYPED_CHILD(Subject,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Conditions,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILD(Advice,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthnStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AttributeStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAMLConstants::SAML20_NS,false); - PROC_TYPED_CHILDREN(Statement,SAMLConstants::SAML20_NS,false); + PROC_TYPED_CHILD(Issuer,SAML20_NS,false); + PROC_TYPED_CHILD(Signature,XMLSIG_NS,false); + PROC_TYPED_CHILD(Subject,SAML20_NS,false); + PROC_TYPED_CHILD(Conditions,SAML20_NS,false); + PROC_TYPED_CHILD(Advice,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthnStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(AttributeStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(AuthzDecisionStatement,SAML20_NS,false); + PROC_TYPED_CHILDREN(Statement,SAML20_NS,false); AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root); } - + void processAttribute(const DOMAttr* attribute) { - PROC_STRING_ATTRIB(Version,VER,NULL); - PROC_ID_ATTRIB(ID,ID,NULL); - PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL); + PROC_STRING_ATTRIB(Version,VER,nullptr); + PROC_ID_ATTRIB(ID,ID,nullptr); + PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,nullptr); AbstractXMLObjectUnmarshaller::processAttribute(attribute); } }; @@ -1530,7 +1659,10 @@ IMPL_XMLOBJECTBUILDER(AuthnContextDecl); IMPL_XMLOBJECTBUILDER(AuthnContextDeclRef); IMPL_XMLOBJECTBUILDER(AuthnStatement); IMPL_XMLOBJECTBUILDER(AuthzDecisionStatement); +IMPL_XMLOBJECTBUILDER(Condition); IMPL_XMLOBJECTBUILDER(Conditions); +IMPL_XMLOBJECTBUILDER(Delegate); +IMPL_XMLOBJECTBUILDER(DelegationRestrictionType); IMPL_XMLOBJECTBUILDER(EncryptedAssertion); IMPL_XMLOBJECTBUILDER(EncryptedAttribute); IMPL_XMLOBJECTBUILDER(EncryptedID); @@ -1541,6 +1673,7 @@ IMPL_XMLOBJECTBUILDER(NameID); IMPL_XMLOBJECTBUILDER(NameIDType); IMPL_XMLOBJECTBUILDER(OneTimeUse); IMPL_XMLOBJECTBUILDER(ProxyRestriction); +IMPL_XMLOBJECTBUILDER(Statement); IMPL_XMLOBJECTBUILDER(Subject); IMPL_XMLOBJECTBUILDER(SubjectConfirmation); IMPL_XMLOBJECTBUILDER(SubjectConfirmationData); @@ -1596,21 +1729,22 @@ const XMLCh Conditions::LOCAL_NAME[] = UNICODE_LITERAL_10(C,o,n,d,i const XMLCh Conditions::TYPE_NAME[] = UNICODE_LITERAL_14(C,o,n,d,i,t,i,o,n,s,T,y,p,e); const XMLCh Conditions::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e); const XMLCh Conditions::NOTONORAFTER_ATTRIB_NAME[] =UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r); +const XMLCh Delegate::LOCAL_NAME[] = UNICODE_LITERAL_8(D,e,l,e,g,a,t,e); +const XMLCh Delegate::TYPE_NAME[] = UNICODE_LITERAL_12(D,e,l,e,g,a,t,e,T,y,p,e); +const XMLCh Delegate::CONFIRMATIONMETHOD_ATTRIB_NAME[] = UNICODE_LITERAL_18(C,o,n,f,i,r,m,a,t,i,o,n,M,e,t,h,o,d); +const XMLCh Delegate::DELEGATIONINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_17(D,e,l,e,g,a,t,i,o,n,I,n,s,t,a,n,t); +const XMLCh DelegationRestrictionType::LOCAL_NAME[] = UNICODE_LITERAL_9(C,o,n,d,i,t,i,o,n); +const XMLCh DelegationRestrictionType::TYPE_NAME[] =UNICODE_LITERAL_25(D,e,l,e,g,a,t,i,o,n,R,e,s,t,r,i,c,t,i,o,n,T,y,p,e); 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); 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); const XMLCh EncryptedElementType::LOCAL_NAME[] = {chNull}; 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); -const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,d); +const XMLCh EncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_11(E,n,c,r,y,p,t,e,d,I,D); const XMLCh Evidence::LOCAL_NAME[] = UNICODE_LITERAL_8(E,v,i,d,e,n,c,e); const XMLCh Evidence::TYPE_NAME[] = UNICODE_LITERAL_12(E,v,i,d,e,n,c,e,T,y,p,e); const XMLCh Issuer::LOCAL_NAME[] = UNICODE_LITERAL_6(I,s,s,u,e,r); 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); 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); -const XMLCh KeyInfoConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e); -const XMLCh KeyInfoConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r); -const XMLCh KeyInfoConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o); -const XMLCh KeyInfoConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t); -const XMLCh KeyInfoConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s); const XMLCh NameID::LOCAL_NAME[] = UNICODE_LITERAL_6(N,a,m,e,I,D); const XMLCh NameIDType::LOCAL_NAME[] = {chNull}; const XMLCh NameIDType::TYPE_NAME[] = UNICODE_LITERAL_10(N,a,m,e,I,D,T,y,p,e); @@ -1630,12 +1764,171 @@ const XMLCh SubjectConfirmation::LOCAL_NAME[] = UNICODE_LITERAL_19(S,u,b,j,e 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); const XMLCh SubjectConfirmation::METHOD_ATTRIB_NAME[] = UNICODE_LITERAL_6(M,e,t,h,o,d); 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); -const XMLCh SubjectConfirmationData::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e); -const XMLCh SubjectConfirmationData::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r); -const XMLCh SubjectConfirmationData::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o); -const XMLCh SubjectConfirmationData::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t); -const XMLCh SubjectConfirmationData::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s); +const XMLCh SubjectConfirmationDataType::NOTBEFORE_ATTRIB_NAME[] = UNICODE_LITERAL_9(N,o,t,B,e,f,o,r,e); +const XMLCh SubjectConfirmationDataType::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r); +const XMLCh SubjectConfirmationDataType::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o); +const XMLCh SubjectConfirmationDataType::RECIPIENT_ATTRIB_NAME[] = UNICODE_LITERAL_9(R,e,c,i,p,i,e,n,t); +const XMLCh SubjectConfirmationDataType::ADDRESS_ATTRIB_NAME[] = UNICODE_LITERAL_7(A,d,d,r,e,s,s); const XMLCh SubjectLocality::LOCAL_NAME[] = UNICODE_LITERAL_15(S,u,b,j,e,c,t,L,o,c,a,l,i,t,y); 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); const XMLCh SubjectLocality::ADDRESS_ATTRIB_NAME[] =UNICODE_LITERAL_7(A,d,d,r,e,s,s); const XMLCh SubjectLocality::DNSNAME_ATTRIB_NAME[] =UNICODE_LITERAL_7(D,N,S,N,a,m,e); + +const XMLCh NameIDType::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull +}; + +const XMLCh NameIDType::EMAIL[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + 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 +}; + +const XMLCh NameIDType::X509_SUBJECT[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_X, chDigit_5, chDigit_0, chDigit_9, chLatin_S, chLatin_u, chLatin_b, chLatin_j, chLatin_e, chLatin_c, chLatin_t, + chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull +}; + +const XMLCh NameIDType::WIN_DOMAIN_QUALIFIED[] = // urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_1, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_W, chLatin_i, chLatin_n, chLatin_d, chLatin_o, chLatin_w, chLatin_s, + chLatin_D, chLatin_o, chLatin_m, chLatin_a, chLatin_i, chLatin_n, + chLatin_Q, chLatin_u, chLatin_a, chLatin_l, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, + chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull +}; + +const XMLCh NameIDType::KERBEROS[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_k, chLatin_e, chLatin_r, chLatin_b, chLatin_e, chLatin_r, chLatin_o, chLatin_s, chNull +}; + +const XMLCh NameIDType::ENTITY[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:entity +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_e, chLatin_n, chLatin_t, chLatin_i, chLatin_t, chLatin_y, chNull +}; + +const XMLCh NameIDType::PERSISTENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_p, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_s, chLatin_t, chLatin_e, chLatin_n, chLatin_t, chNull +}; + +const XMLCh NameIDType::TRANSIENT[] = // urn:oasis:names:tc:SAML:2.0:nameid-format:transient +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_i, chLatin_d, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_t, chLatin_r, chLatin_a, chLatin_n, chLatin_s, chLatin_i, chLatin_e, chLatin_n, chLatin_t, chNull +}; + +const XMLCh SubjectConfirmation::BEARER[] = // urn:oasis:names:tc:SAML:2.0:cm:bearer +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_b, chLatin_e, chLatin_a, chLatin_r, chLatin_e, chLatin_r, chNull +}; + +const XMLCh SubjectConfirmation::HOLDER_KEY[] = // urn:oasis:names:tc:SAML:2.0:cm:holder-of-key +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_h, chLatin_o, chLatin_l, chLatin_d, chLatin_e, chLatin_r, chDash, + chLatin_o, chLatin_f, chDash, chLatin_k, chLatin_e, chLatin_y, chNull +}; + +const XMLCh SubjectConfirmation::SENDER_VOUCHES[] = // urn:oasis:names:tc:SAML:2.0:cm:sender-vouches +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_c, chLatin_m, chColon, chLatin_s, chLatin_e, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chDash, + chLatin_v, chLatin_o, chLatin_u, chLatin_c, chLatin_h, chLatin_e, chLatin_s, chNull +}; + +const XMLCh Action::RWEDC_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chNull +}; + +const XMLCh Action::RWEDC_NEG_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:rwedc-negation +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_r, chLatin_w, chLatin_e, chLatin_d, chLatin_c, chDash, + chLatin_n, chLatin_e, chLatin_g, chLatin_a, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chNull +}; + +const XMLCh Action::GHPP_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:ghpp +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_g, chLatin_h, chLatin_p, chLatin_p, chNull +}; + +const XMLCh Action::UNIX_ACTION_NAMESPACE[] = // urn:oasis:names:tc:SAML:1.0:action:unix +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_1, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_c, chLatin_t, chLatin_i, chLatin_o, chLatin_n, chColon, + chLatin_u, chLatin_n, chLatin_i, chLatin_x, chNull +}; + +const XMLCh Attribute::UNSPECIFIED[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_n, chLatin_s, chLatin_p, chLatin_e, chLatin_c, chLatin_i, chLatin_f, chLatin_i, chLatin_e, chLatin_d, chNull +}; + +const XMLCh Attribute::URI_REFERENCE[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:uri +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_u, chLatin_r, chLatin_i, chNull +}; + +const XMLCh Attribute::BASIC[] = // urn:oasis:names:tc:SAML:2.0:attrname-format:basic +{ chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon, + chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon, + chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon, + chLatin_a, chLatin_t, chLatin_t, chLatin_r, chLatin_n, chLatin_a, chLatin_m, chLatin_e, chDash, + chLatin_f, chLatin_o, chLatin_r, chLatin_m, chLatin_a, chLatin_t, chColon, + chLatin_b, chLatin_a, chLatin_s, chLatin_i, chLatin_c, chNull +};