https://issues.shibboleth.net/jira/browse/CPPXT-70
[shibboleth/cpp-xmltooling.git] / xmltooling / security / PKIXPathValidatorParams.h
1 /**
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.
6  *
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
10  * License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  */
20
21 /**
22  * @file xmltooling/security/PKIXPathValidatorParams.h
23  * 
24  * PKIX-specific parameters to a PathValidator.
25  */
26
27 #if !defined(__xmltooling_pkixvalparam_h__) && !defined(XMLTOOLING_NO_XMLSEC)
28 #define __xmltooling_pkixvalparam_h__
29
30 #include <xmltooling/security/PathValidator.h>
31
32 #include <set>
33 #include <string>
34
35 namespace xmltooling {
36
37     class XMLTOOL_API XSECCryptoX509CRL;
38
39     /**
40      * PKIX-specific parameters to a PathValidator.
41      */
42     class XMLTOOL_API PKIXPathValidatorParams : public PathValidator::PathValidatorParams
43     {
44     protected:
45         PKIXPathValidatorParams();
46
47     public:
48         virtual ~PKIXPathValidatorParams();
49
50         /**
51          * Returns the allowable trust chain verification depth.
52          * 
53          * @return  allowable trust chain verification depth
54          */
55         virtual int getVerificationDepth() const=0;
56
57         /**
58          * Checks whether the any policy OID should be processed
59          * if it is included in a certificate.
60          *
61          * @return true iff the any policy OID should *not* be processed
62          */
63         virtual bool isAnyPolicyInhibited() const=0;
64
65         /**
66          * Checks if policy mapping is inhibited.
67          *
68          * @return true iff policy mapping should not be allowed
69          */
70         virtual bool isPolicyMappingInhibited() const=0;
71
72         /**
73          * Returns a set of policy OIDs.
74          *
75          * @return set of policy OIDs
76          */
77         virtual const std::set<std::string>& getPolicies() const=0;
78
79         /**
80          * Returns a set of trust anchors.
81          * 
82          * @return  set of trust anchors
83          */
84         virtual const std::vector<XSECCryptoX509*>& getTrustAnchors() const=0;
85
86         enum revocation_t {
87             REVOCATION_OFF = 0,
88             REVOCATION_ENTITYONLY = 1,
89             REVOCATION_FULLCHAIN = 2
90         };
91
92         /**
93          * Returns the type of revocation checking to perform.
94          *
95          * @return  revocation checking option
96          */
97         virtual revocation_t getRevocationChecking() const=0;
98
99         /**
100          * Returns a set of CRLs.
101          * 
102          * @return  set of CRLs
103          */
104         virtual const std::vector<XSECCryptoX509CRL*>& getCRLs() const=0;
105     };
106 };
107
108 #endif /* __xmltooling_pkixvalparam_h__ */