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