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/X509TrustEngine.h
20 * Extended TrustEngine interface that adds validation of X.509 credentials.
23 #if !defined(__xmltooling_x509trust_h__) && !defined(XMLTOOLING_NO_XMLSEC)
24 #define __xmltooling_x509trust_h__
26 #include <xmltooling/security/TrustEngine.h>
28 namespace xmltooling {
31 * Extended TrustEngine interface that adds validation of X.509 credentials.
33 class XMLTOOL_API X509TrustEngine : public TrustEngine {
38 * If a DOM is supplied, the following XML content is supported:
41 * <li><KeyResolver> elements with a type attribute
44 * XML namespaces are ignored in the processing of this content.
46 * @param e DOM to supply configuration for provider
48 X509TrustEngine(const DOMElement* e=NULL) : TrustEngine(e) {}
51 virtual ~X509TrustEngine() {}
54 * Determines whether an X.509 credential is valid with respect to the
55 * source of KeyInfo data supplied. It is the responsibility of the
56 * application to ensure that the KeyInfo information supplied is in fact
57 * associated with the peer who presented the credential.
59 * A custom KeyResolver can be supplied from outside the TrustEngine.
60 * Alternatively, one may be specified to the plugin constructor.
61 * A non-caching, inline resolver will be used as a fallback.
63 * @param certEE end-entity certificate to validate
64 * @param certChain the complete set of certificates presented for validation (includes certEE)
65 * @param keyInfoSource supplies KeyInfo objects to the TrustEngine
66 * @param checkName true iff certificate subject/name checking has <b>NOT</b> already occurred
67 * @param keyResolver optional externally supplied KeyResolver, or NULL
69 virtual bool validate(
70 XSECCryptoX509* certEE,
71 const std::vector<XSECCryptoX509*>& certChain,
72 const KeyInfoSource& keyInfoSource,
74 const KeyResolver* keyResolver=NULL
80 #endif /* __xmltooling_x509trust_h__ */