2 * Copyright 2001-2007 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/TrustEngine.h
20 * Evaluates the trustworthiness and validity of security information against
21 * implementation-specific requirements.
24 #if !defined(__xmltooling_trust_h__) && !defined(XMLTOOLING_NO_XMLSEC)
25 #define __xmltooling_trust_h__
27 #include <xmltooling/base.h>
29 namespace xmltooling {
31 class XMLTOOL_API KeyInfoResolver;
34 * Evaluates the trustworthiness and validity of security information against
35 * implementation-specific requirements.
37 class XMLTOOL_API TrustEngine {
38 MAKE_NONCOPYABLE(TrustEngine);
43 * If a DOM is supplied, the following XML content is supported:
46 * <li><KeyInfoResolver> elements with a type attribute
49 * XML namespaces are ignored in the processing of this content.
51 * @param e DOM to supply configuration for provider
53 TrustEngine(const xercesc::DOMElement* e=NULL);
55 /** Custom KeyInfoResolver instance. */
56 KeyInfoResolver* m_keyInfoResolver;
59 virtual ~TrustEngine();
62 * Supplies a KeyInfoResolver instance.
63 * <p>This method must be externally synchronized with any code that uses the object.
64 * Any previously set object is destroyed.
66 * @param keyInfoResolver new KeyInfoResolver instance to use
68 void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver);
72 * Registers TrustEngine classes into the runtime.
74 void XMLTOOL_API registerTrustEngines();
76 /** TrustEngine based on explicit knowledge of peer key information. */
77 #define EXPLICIT_KEY_TRUSTENGINE "ExplicitKey"
79 /** TrustEngine that tries multiple engines in sequence. */
80 #define CHAINING_TRUSTENGINE "Chaining"
84 #endif /* __xmltooling_trust_h__ */