X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Fencryption%2Fimpl%2FEncryptionSchemaValidators.cpp;h=4adcb7b3096ee543f82e9e1a17c3f7e38c21946b;hb=5cb314df178f78c6fa7b9826c2c5a5298ec7a473;hp=0ee94675c483db0ecaaa315d12c67b160669b67a;hpb=a514742cd7ede892f18ad7e2deefed1c1712a517;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp b/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp index 0ee9467..4adcb7b 100644 --- a/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp +++ b/xmltooling/encryption/impl/EncryptionSchemaValidators.cpp @@ -1,5 +1,5 @@ /* -* Copyright 2001-2006 Internet2 +* Copyright 2001-2007 Internet2 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,10 +23,12 @@ #include "internal.h" #include "exceptions.h" #include "encryption/Encryption.h" +#include "validation/ValidatorSuite.h" using namespace xmlencryption; using namespace xmltooling; using namespace std; +using xmlconstants::XMLENC_NS; namespace xmlencryption { @@ -55,7 +57,7 @@ namespace xmlencryption { public: void operator()(const XMLObject* xmlObject) const { const XMLCh* ns=xmlObject->getElementQName().getNamespaceURI(); - if (XMLString::equals(ns,XMLConstants::XMLENC_NS) || !ns || !*ns) { + if (XMLString::equals(ns,XMLENC_NS) || !ns || !*ns) { throw ValidationException( "Object contains an illegal extension child element ($1).", params(1,xmlObject->getElementQName().toString().c_str()) @@ -67,7 +69,7 @@ namespace xmlencryption { BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,EncryptionProperty); if (!ptr->hasChildren()) throw ValidationException("EncryptionProperty must have at least one child element."); - const list& anys=ptr->getXMLObjects(); + const vector& anys=ptr->getUnknownXMLObjects(); for_each(anys.begin(),anys.end(),checkWildcardNS()); END_XMLOBJECTVALIDATOR; @@ -77,7 +79,7 @@ namespace xmlencryption { BEGIN_XMLOBJECTVALIDATOR(XMLTOOL_DLLLOCAL,ReferenceType); XMLOBJECTVALIDATOR_REQUIRE(DataReference,URI); - const list& anys=ptr->getXMLObjects(); + const vector& anys=ptr->getUnknownXMLObjects(); for_each(anys.begin(),anys.end(),checkWildcardNS()); END_XMLOBJECTVALIDATOR; @@ -121,25 +123,25 @@ namespace xmlencryption { void xmlencryption::registerEncryptionClasses() { QName q; - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CarriedKeyName); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherData); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,CipherValue); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,DataReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptedData); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptedKey); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionMethod); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionProperties); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,EncryptionProperty); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,KeyReference); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,KeySize); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,OAEPparams); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,ReferenceList); - REGISTER_ELEMENT(XMLConstants::XMLENC_NS,Transforms); - REGISTER_TYPE(XMLConstants::XMLENC_NS,CipherData); - REGISTER_TYPE(XMLConstants::XMLENC_NS,CipherReference); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionMethod); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionProperties); - REGISTER_TYPE(XMLConstants::XMLENC_NS,EncryptionProperty); - REGISTER_TYPE(XMLConstants::XMLENC_NS,Transforms); + REGISTER_ELEMENT(XMLENC_NS,CarriedKeyName); + REGISTER_ELEMENT(XMLENC_NS,CipherData); + REGISTER_ELEMENT(XMLENC_NS,CipherReference); + REGISTER_ELEMENT(XMLENC_NS,CipherValue); + REGISTER_ELEMENT(XMLENC_NS,DataReference); + REGISTER_ELEMENT(XMLENC_NS,EncryptedData); + REGISTER_ELEMENT(XMLENC_NS,EncryptedKey); + REGISTER_ELEMENT(XMLENC_NS,EncryptionMethod); + REGISTER_ELEMENT(XMLENC_NS,EncryptionProperties); + REGISTER_ELEMENT(XMLENC_NS,EncryptionProperty); + REGISTER_ELEMENT(XMLENC_NS,KeyReference); + REGISTER_ELEMENT(XMLENC_NS,KeySize); + REGISTER_ELEMENT(XMLENC_NS,OAEPparams); + REGISTER_ELEMENT(XMLENC_NS,ReferenceList); + REGISTER_ELEMENT(XMLENC_NS,Transforms); + REGISTER_TYPE(XMLENC_NS,CipherData); + REGISTER_TYPE(XMLENC_NS,CipherReference); + REGISTER_TYPE(XMLENC_NS,EncryptionMethod); + REGISTER_TYPE(XMLENC_NS,EncryptionProperties); + REGISTER_TYPE(XMLENC_NS,EncryptionProperty); + REGISTER_TYPE(XMLENC_NS,Transforms); }