2 * Copyright 2001-2010 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>
28 #include <xercesc/dom/DOM.hpp>
30 namespace xmltooling {
32 class XMLTOOL_API KeyInfoResolver;
35 * Evaluates the trustworthiness and validity of security information against
36 * implementation-specific requirements.
38 class XMLTOOL_API TrustEngine {
39 MAKE_NONCOPYABLE(TrustEngine);
44 * If a DOM is supplied, the following XML content is supported:
47 * <li><KeyInfoResolver> elements with a type attribute
50 * XML namespaces are ignored in the processing of this content.
52 * @param e DOM to supply configuration for provider
54 TrustEngine(const xercesc::DOMElement* e=nullptr);
56 /** Custom KeyInfoResolver instance. */
57 KeyInfoResolver* m_keyInfoResolver;
60 virtual ~TrustEngine();
63 * Supplies a KeyInfoResolver instance.
64 * <p>This method must be externally synchronized with any code that uses the object.
65 * Any previously set object is destroyed.
67 * @param keyInfoResolver new KeyInfoResolver instance to use
69 void setKeyInfoResolver(KeyInfoResolver* keyInfoResolver);
73 * Registers TrustEngine classes into the runtime.
75 void XMLTOOL_API registerTrustEngines();
77 /** TrustEngine based on explicit knowledge of peer key information. */
78 #define EXPLICIT_KEY_TRUSTENGINE "ExplicitKey"
80 /** TrustEngine based on PKIX evaluation against a static set of trust anchors. */
81 #define STATIC_PKIX_TRUSTENGINE "StaticPKIX"
83 /** TrustEngine that tries multiple engines in sequence. */
84 #define CHAINING_TRUSTENGINE "Chaining"
88 #endif /* __xmltooling_trust_h__ */