2 * Licensed to the University Corporation for Advanced Internet
3 * Development, Inc. (UCAID) under one or more contributor license
4 * agreements. See the NOTICE file distributed with this work for
5 * additional information regarding copyright ownership.
7 * UCAID licenses this file to you under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except
9 * in compliance with the License. You may obtain a copy of the
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17 * either express or implied. See the License for the specific
18 * language governing permissions and limitations under the License.
22 * @file xmltooling/security/PathValidator.h
24 * Plugin interface to certificate path validation.
27 #if !defined(__xmltooling_pathval_h__) && !defined(XMLTOOLING_NO_XMLSEC)
28 #define __xmltooling_pathval_h__
34 namespace xmltooling {
37 * Plugin interface to certificate path validation, independent of context.
38 * <p>This interface assumes that the end-entity certificate is "correctly"
39 * bound to a party, and solely addresses the validity of that certificate.
41 class XMLTOOL_API PathValidator
43 MAKE_NONCOPYABLE(PathValidator);
48 virtual ~PathValidator();
51 * Marker interface for plugin-specific parameters into the validation
54 class XMLTOOL_API PathValidatorParams {
55 MAKE_NONCOPYABLE(PathValidatorParams);
57 PathValidatorParams();
60 virtual ~PathValidatorParams();
64 * Validates an end-entity certificate.
66 * @param certEE end-entity certificate
67 * @param certChain the complete untrusted certificate chain
68 * @param params plugin-specific parameters to the validation process
69 * @return true iff validaton succeeds
71 virtual bool validate(
72 XSECCryptoX509* certEE,
73 const std::vector<XSECCryptoX509*>& certChain,
74 const PathValidatorParams& params
79 * Registers PathValidator classes into the runtime.
81 void XMLTOOL_API registerPathValidators();
83 /** PathValidator based on PKIX. */
84 #define PKIX_PATHVALIDATOR "PKIX"
87 #endif /* __xmltooling_pathval_h__ */