ccfe05c17cc0f26d84d0bd6340065cf8a761afb0
[shibboleth/cpp-xmltooling.git] / xmltooling / security / XSECCryptoX509CRL.h
1 /*
2  * Copyright 2001-2009 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * @file xmltooling/security/XSECCryptoX509CRL.h
19  * 
20  * Wrapper for X.509 CRL objects, similar to existing XSEC wrappers.
21  */
22
23 #if !defined(__xmltooling_x509crl_h__) && !defined(XMLTOOLING_NO_XMLSEC)
24 #define __xmltooling_x509crl_h__
25
26 #include <xmltooling/base.h>
27
28 #include <xsec/framework/XSECDefs.hpp>
29 #include <xsec/utils/XSECSafeBuffer.hpp>
30
31 namespace xmltooling {
32     /**
33      * Interface class for X.509 CRLs
34      * The library uses classes derived from this to process X.509 CRLs.
35      */
36     class XMLTOOL_API XSECCryptoX509CRL {
37         MAKE_NONCOPYABLE(XSECCryptoX509CRL);
38     protected:
39         XSECCryptoX509CRL();
40     public:
41         virtual ~XSECCryptoX509CRL();
42     
43         /**
44          * Returns a string that identifies the crypto owner of this library.
45          * 
46          * @return  the crypto provider name
47          */
48         virtual const XMLCh* getProviderName() const=0;
49     
50         /**
51          * Returns a duplicate of the original object.
52          *
53          * @return  the duplicate
54          */
55         virtual XSECCryptoX509CRL* clone() const=0;
56
57         /**
58          * Load a Base64-encoded CRL into the object.
59          *
60          * @param buf buffer containing the base64-encoded CRL
61          * @param len number of bytes of data in the CRL buffer (0 if the string is null terminated)
62          */
63         virtual void loadX509CRLBase64Bin(const char* buf, unsigned int len)=0;
64     
65         /**
66          * Load a PEM encoded CRL into the object.
67          *
68          * @param buf buffer containing the PEM encoded CRL
69          * @param len number of bytes of data in the CRL buffer (0 if the string is null terminated)
70          */
71         void loadX509CRLPEM(const char* buf, unsigned int len=0);
72     
73         /**
74          * Get a Base64 DER encoded copy of the CRL
75          *
76          * @return A safeBuffer containing the DER encoded certificate
77          */
78         virtual safeBuffer& getDEREncodingSB(void)=0;
79     };
80 };
81
82 #endif /* __xmltooling_x509crl_h__ */
83
84