Extended KeyResolver to handle CRLs.
[shibboleth/cpp-xmltooling.git] / xmltooling / security / impl / OpenSSLCryptoX509CRL.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  * OpenSSLCryptoX509CRL.h\r
19  * \r
20  * OpenSSL-based class for handling X.509 CRLs\r
21  */\r
22 \r
23 #if !defined(__xmltooling_opensslx509crl_h__) && !defined(XMLTOOLING_NO_XMLSEC)\r
24 #define __xmltooling_opensslx509crl_h__\r
25 \r
26 #include "security/XSECCryptoX509CRL.h"\r
27 \r
28 #include <openssl/bio.h>\r
29 #include <openssl/x509v3.h>\r
30 #include <xsec/utils/XSECSafeBuffer.hpp>\r
31 \r
32 namespace xmltooling {\r
33     class XMLTOOL_DLLLOCAL OpenSSLCryptoX509CRL : public XSECCryptoX509CRL {\r
34     public:\r
35         OpenSSLCryptoX509CRL() : mp_X509CRL(NULL), m_DERX509CRL("") {}\r
36         virtual ~OpenSSLCryptoX509CRL();\r
37 \r
38         virtual const XMLCh* getProviderName() const {\r
39             return DSIGConstants::s_unicodeStrPROVOpenSSL;\r
40         }\r
41         virtual void loadX509CRLBase64Bin(const char* buf, unsigned int len);\r
42     \r
43         virtual safeBuffer& getDEREncodingSB(void) {\r
44             return m_DERX509CRL;\r
45         }\r
46     \r
47         OpenSSLCryptoX509CRL(X509_CRL* x);\r
48         X509_CRL* getOpenSSLX509CRL(void) {\r
49             return mp_X509CRL;\r
50         }\r
51 \r
52         XSECCryptoX509CRL* clone() const {\r
53             OpenSSLCryptoX509CRL* copy = new OpenSSLCryptoX509CRL();\r
54             copy->mp_X509CRL = X509_CRL_dup(mp_X509CRL);\r
55             copy->m_DERX509CRL = m_DERX509CRL;\r
56             return copy;\r
57         }\r
58     \r
59     private:\r
60         X509_CRL* mp_X509CRL;\r
61         safeBuffer m_DERX509CRL;\r
62     };\r
63 };\r
64 \r
65 #endif /* __xmltooling_opensslx509crl_h__ */\r
66 \r