#include <xmltooling/AbstractComplexElement.h>
#include <xmltooling/AbstractSimpleElement.h>
-#include <xmltooling/encryption/Decrypter.h>
#include <xmltooling/impl/AnyElement.h>
#include <xmltooling/io/AbstractXMLObjectMarshaller.h>
#include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
namespace opensaml {
namespace saml2 {
-
+
DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionIDRef);
DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AssertionURIRef);
DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Audience);
}
}
}
-
- 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<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
- ret->releaseThisAndChildrenDOM();
- return ret.release();
- }
- }
- frag->release();
- throw DecryptionException("Decryption did not result in a single element.");
- }
IMPL_XMLOBJECT_CLONE(EncryptedElementType);
IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
}
};
- //TODO unit test for this
class SAML_DLLLOCAL EncryptedIDImpl : public virtual EncryptedID, public EncryptedElementTypeImpl
{
public:
}
};
- class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType,
- public AbstractDOMCachingXMLObject,
- public AbstractXMLObjectMarshaller,
- public AbstractXMLObjectUnmarshaller
+ class SAML_DLLLOCAL SubjectConfirmationDataTypeImpl : public virtual SubjectConfirmationDataType, public virtual AbstractXMLObject
{
void init() {
m_NotBefore=m_NotOnOrAfter=NULL;
init();
}
- SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractDOMCachingXMLObject(src) {
+ SubjectConfirmationDataTypeImpl(const SubjectConfirmationDataTypeImpl& src) : AbstractXMLObject(src) {
init();
setNotBefore(src.getNotBefore());
setNotOnOrAfter(src.getNotOnOrAfter());
PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
- AbstractXMLObjectUnmarshaller::processAttribute(attribute);
}
};
SubjectConfirmationDataTypeImpl::marshallAttributes(domElement);
AnyElementImpl::marshallAttributes(domElement);
}
+
+ void processAttribute(const DOMAttr* attribute) {
+ PROC_DATETIME_ATTRIB(NotBefore,NOTBEFORE,NULL);
+ PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
+ PROC_STRING_ATTRIB(Recipient,RECIPIENT,NULL);
+ PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
+ PROC_STRING_ATTRIB(Address,ADDRESS,NULL);
+ AnyElementImpl::processAttribute(attribute);
+ }
};
class SAML_DLLLOCAL KeyInfoConfirmationDataTypeImpl : public virtual KeyInfoConfirmationDataType,
public SubjectConfirmationDataTypeImpl,
public AbstractComplexElement,
- public AbstractAttributeExtensibleXMLObject
+ public AbstractAttributeExtensibleXMLObject,
+ public AbstractDOMCachingXMLObject,
+ public AbstractXMLObjectMarshaller,
+ public AbstractXMLObjectUnmarshaller
{
public:
virtual ~KeyInfoConfirmationDataTypeImpl() {}
KeyInfoConfirmationDataTypeImpl(const KeyInfoConfirmationDataTypeImpl& src)
: AbstractXMLObject(src), SubjectConfirmationDataTypeImpl(src), AbstractComplexElement(src),
- AbstractAttributeExtensibleXMLObject(src) {
+ AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
VectorOf(KeyInfo) v=getKeyInfos();
for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
v.push_back((*i)->cloneKeyInfo());