-ChainingTrustEngine::ChainingTrustEngine(const DOMElement* e) : X509TrustEngine(e) {
- try {
- e = e ? xmltooling::XMLHelper::getFirstChildElement(e, GenericTrustEngine) : NULL;
- while (e) {
- xmltooling::auto_ptr_char temp(e->getAttributeNS(NULL,type));
- if (temp.get()) {
- auto_ptr<TrustEngine> engine(
- XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(temp.get(), e)
- );
- X509TrustEngine* x509 = dynamic_cast<X509TrustEngine*>(engine.get());
- if (x509) {
- m_engines.push_back(x509);
- engine.release();
- }
- else {
- throw xmltooling::UnknownExtensionException("Embedded trust engine does not support required interface.");
- }
+ChainingTrustEngine::ChainingTrustEngine(const DOMElement* e) : TrustEngine(e) {
+ Category& log=Category::getInstance(XMLTOOLING_LOGCAT".TrustEngine."CHAINING_TRUSTENGINE);
+ e = e ? XMLHelper::getFirstChildElement(e, _TrustEngine) : NULL;
+ while (e) {
+ try {
+ auto_ptr_char temp(e->getAttributeNS(NULL,type));
+ if (temp.get() && *temp.get()) {
+ log.info("building TrustEngine of type %s", temp.get());
+ TrustEngine* engine = XMLToolingConfig::getConfig().TrustEngineManager.newPlugin(temp.get(), e);
+ m_engines.push_back(engine);
+ SignatureTrustEngine* sig = dynamic_cast<SignatureTrustEngine*>(engine);
+ if (sig)
+ m_sigEngines.push_back(sig);
+ X509TrustEngine* x509 = dynamic_cast<X509TrustEngine*>(engine);
+ if (x509)
+ m_x509Engines.push_back(x509);
+ OpenSSLTrustEngine* ossl = dynamic_cast<OpenSSLTrustEngine*>(engine);
+ if (ossl)
+ m_osslEngines.push_back(ossl);