Extended KeyResolver to handle CRLs.
[shibboleth/cpp-xmltooling.git] / xmltooling / security / XSECCryptoX509CRL.h
1 /*\r
2  * Copyright 2006 The Apache Software Foundation.\r
3  *\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
7  *\r
8  *     http://www.apache.org/licenses/LICENSE-2.0\r
9  *\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
15  */\r
16 \r
17 /**\r
18  * @file xmltooling/security/XSECCryptoX509CRL.h\r
19  * \r
20  * Wrapper for X.509 CRL objects, similar to existing XSEC wrappers.\r
21  */\r
22 \r
23 #if !defined(__xmltooling_x509crl_h__) && !defined(XMLTOOLING_NO_XMLSEC)\r
24 #define __xmltooling_x509crl_h__\r
25 \r
26 #include <xmltooling/base.h>\r
27 \r
28 #include <xsec/framework/XSECDefs.hpp>\r
29 #include <xsec/utils/XSECSafeBuffer.hpp>\r
30 \r
31 namespace xmltooling {\r
32     /**\r
33      * Interface class for X.509 CRLs\r
34      * The library uses classes derived from this to process X.509 CRLs.\r
35      */\r
36     class XMLTOOL_API XSECCryptoX509CRL {\r
37         MAKE_NONCOPYABLE(XSECCryptoX509CRL);\r
38     protected:\r
39         XSECCryptoX509CRL() {}\r
40     public:\r
41         virtual ~XSECCryptoX509CRL() {}\r
42     \r
43         /**\r
44          * Returns a string that identifies the crypto owner of this library.\r
45          * \r
46          * @return  the crypto provider name\r
47          */\r
48         virtual const XMLCh* getProviderName() const=0;\r
49     \r
50         /**\r
51          * Load a CRL into the object.\r
52          * Takes a base64 DER-encoded CRL and loads it.\r
53          *\r
54          * @param buf buffer containing the Base64 encoded CRL\r
55          * @param len number of bytes of data in the CRL buffer\r
56          */\r
57     \r
58         /**\r
59          * Returns a duplicate of the original object.\r
60          *\r
61          * @return  the duplicate\r
62          */\r
63         virtual XSECCryptoX509CRL* clone() const=0;\r
64 \r
65         virtual void loadX509CRLBase64Bin(const char* buf, unsigned int len)=0;\r
66     \r
67         /**\r
68          * Load a PEM encoded CRL into the object.\r
69          *\r
70          * Takes a PEM encoded CRL and loads it.\r
71          *\r
72          * @param buf buffer containing the PEM encoded CRL\r
73          * @param len number of bytes of data in the CRL buffer (0 if the string is null terminated)\r
74          */\r
75         void loadX509CRLPEM(const char* buf, unsigned int len=0);\r
76     \r
77         /**\r
78          * Get a Base64 DER encoded copy of the CRL\r
79          *\r
80          * @return A safeBuffer containing the DER encoded certificate\r
81          */\r
82         virtual safeBuffer& getDEREncodingSB(void)=0;\r
83     };\r
84 };\r
85 \r
86 #endif /* __xmltooling_x509crl_h__ */\r
87 \r
88 \r