2 * Copyright 2001-2006 Internet2
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 * @file saml/security/X509TrustEngine.h
\r
20 * Extended TrustEngine interface that adds validation of X.509 credentials.
\r
23 #ifndef __saml_x509trust_h__
\r
24 #define __saml_x509trust_h__
\r
26 #include <saml/security/TrustEngine.h>
\r
28 namespace opensaml {
\r
31 * Extended TrustEngine interface that adds validation of X.509 credentials.
\r
33 class SAML_API X509TrustEngine : public TrustEngine {
\r
38 * If a DOM is supplied, the following XML content is supported:
\r
41 * <li><KeyResolver> elements with a type attribute
\r
44 * XML namespaces are ignored in the processing of this content.
\r
46 * @param e DOM to supply configuration for provider
\r
48 X509TrustEngine(const DOMElement* e=NULL) : TrustEngine(e) {}
\r
51 virtual ~X509TrustEngine() {}
\r
54 * Determines whether an X.509 credential is valid with respect
\r
55 * to the information known about the peer.
\r
57 * A custom KeyResolver can be supplied from outside the TrustEngine.
\r
58 * Alternatively, one may be specified to the plugin constructor.
\r
59 * A non-caching, inline resolver will be used as a fallback.
\r
61 * @param certEE end-entity certificate to validate
\r
62 * @param certChain the complete set of certificates presented for validation (includes certEE)
\r
63 * @param role metadata role supplying key information
\r
64 * @param checkName true iff certificate subject/name checking has <b>NOT</b> already occurred
\r
65 * @param keyResolver optional externally supplied KeyResolver, or NULL
\r
67 virtual bool validate(
\r
68 XSECCryptoX509* certEE,
\r
69 const std::vector<XSECCryptoX509*>& certChain,
\r
70 const saml2md::RoleDescriptor& role,
\r
71 bool checkName=true,
\r
72 const xmlsignature::KeyResolver* keyResolver=NULL
\r
78 #endif /* __saml_x509trust_h__ */
\r