#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(const CredentialResolver* KEKresolver, const XMLCh* recipient) const
- {
- if (!m_EncryptedData)
- throw DecryptionException("No encrypted data present.");
- EncryptedKeyResolver ekr(*this, recipient);
- Decrypter decrypter(KEKresolver, &ekr);
- 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: