2 * Copyright 2001-2009 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file xmltooling/security/ChainingTrustEngine.h
20 * OpenSSLTrustEngine that uses multiple engines in sequence.
23 #if !defined(__xmltooling_chaintrust_h__) && !defined(XMLTOOLING_NO_XMLSEC)
24 #define __xmltooling_chaintrust_h__
26 #include <xmltooling/security/OpenSSLTrustEngine.h>
27 #include <xmltooling/security/SignatureTrustEngine.h>
29 namespace xmltooling {
32 * OpenSSLTrustEngine that uses multiple engines in sequence.
34 class XMLTOOL_API ChainingTrustEngine : public SignatureTrustEngine, public OpenSSLTrustEngine {
39 * If a DOM is supplied, the following XML content is supported:
42 * <li><TrustEngine> elements with a type attribute
45 * XML namespaces are ignored in the processing of this content.
47 * @param e DOM to supply configuration for provider
49 ChainingTrustEngine(const xercesc::DOMElement* e=NULL);
52 * Destructor will delete any embedded engines.
54 virtual ~ChainingTrustEngine();
57 * Adds a trust engine for future calls.
59 * @param newEngine trust engine to add
61 void addTrustEngine(TrustEngine* newEngine);
64 * Removes a trust engine. The caller must delete the engine if necessary.
66 * @param oldEngine trust engine to remove
67 * @return the old engine
69 TrustEngine* removeTrustEngine(TrustEngine* oldEngine);
72 xmlsignature::Signature& sig,
73 const CredentialResolver& credResolver,
74 CredentialCriteria* criteria=NULL
77 const XMLCh* sigAlgorithm,
79 xmlsignature::KeyInfo* keyInfo,
82 const CredentialResolver& credResolver,
83 CredentialCriteria* criteria=NULL
86 XSECCryptoX509* certEE,
87 const std::vector<XSECCryptoX509*>& certChain,
88 const CredentialResolver& credResolver,
89 CredentialCriteria* criteria=NULL
93 STACK_OF(X509)* certChain,
94 const CredentialResolver& credResolver,
95 CredentialCriteria* criteria=NULL
98 std::vector<TrustEngine*> m_engines;
99 std::vector<SignatureTrustEngine*> m_sigEngines;
100 std::vector<X509TrustEngine*> m_x509Engines;
101 std::vector<OpenSSLTrustEngine*> m_osslEngines;
106 #endif /* __xmltooling_chaintrust_h__ */