Multi-line svn commit, see body.
[shibboleth/cpp-opensaml.git] / saml / saml2 / core / impl / Protocols20Impl.cpp
index e4b652e..75a7cdc 100644 (file)
 
 #include "internal.h"
 #include "exceptions.h"
-#include "saml/encryption/EncryptedKeyResolver.h"
 #include "saml2/core/Protocols.h"
 
 #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>
@@ -1288,29 +1286,6 @@ namespace opensaml {
                 }
             }
     
-            XMLObject* decrypt(const CredentialResolver& credResolver, const XMLCh* recipient, CredentialCriteria* criteria) const
-            {
-                if (!m_EncryptedData)
-                    throw DecryptionException("No encrypted data present.");
-                EncryptedKeyResolver ekr(*this);
-                Decrypter decrypter(&credResolver, criteria, &ekr);
-                DOMDocumentFragment* frag = decrypter.decryptData(*m_EncryptedData, recipient);
-                if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
-                    DOMNode* plaintext=frag->getFirstChild();
-                    if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
-                        // Import the tree into a new Document that we can bind to the unmarshalled object.
-                        XercesJanitor<DOMDocument> newdoc(XMLToolingConfig::getConfig().getParser().newDocument());
-                        DOMElement* treecopy = static_cast<DOMElement*>(newdoc->importNode(plaintext, true));
-                        newdoc->appendChild(treecopy);
-                        auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(treecopy, true));
-                        newdoc.release();
-                        return ret.release();
-                    }
-                }
-                frag->release();
-                throw DecryptionException("Decryption did not result in a single element.");
-            }
-        
             IMPL_XMLOBJECT_CLONE(NewEncryptedID);
             EncryptedElementType* cloneEncryptedElementType() const {
                 return new NewEncryptedIDImpl(*this);