Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

OpenSSLCryptoBase64.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * OpenSSLCryptoBase64 := Base virtual class to define a base64 encoder/decoder
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: OpenSSLCryptoBase64.hpp,v 1.8 2005/02/03 13:13:08 milan Exp $
00025  *
00026  */
00027 
00028 #ifndef OPENSSLCRYPTOBASE64_INCLUDE
00029 #define OPENSSLCRYPTOBASE64_INCLUDE
00030 
00031 #include <xsec/framework/XSECDefs.hpp>
00032 #include <xsec/enc/XSECCryptoBase64.hpp>
00033 
00034 // OpenSSL
00035 #if defined (HAVE_OPENSSL)
00036 #   include <openssl/evp.h>
00037 
00041  /*\@{*/
00042 
00060 class DSIG_EXPORT OpenSSLCryptoBase64 : public XSECCryptoBase64 {
00061 
00062 
00063 public :
00064 
00065     
00066     OpenSSLCryptoBase64() {};
00067     virtual ~OpenSSLCryptoBase64() {};
00068 
00071 
00080     virtual void decodeInit(void);
00081 
00100     virtual unsigned int decode(const unsigned char * inData, 
00101                                 unsigned int inLength,
00102                                 unsigned char * outData,
00103                                 unsigned int outLength);
00104 
00105 
00117     virtual unsigned int decodeFinish(unsigned char * outData,
00118                                       unsigned int outLength);
00119 
00121 
00124 
00132     virtual void         encodeInit(void);
00133 
00150     virtual unsigned int encode(const unsigned char * inData, 
00151                                 unsigned int inLength,
00152                                 unsigned char * outData,
00153                                 unsigned int outLength);
00154 
00166     virtual unsigned int encodeFinish(unsigned char * outData,
00167                                       unsigned int outLength);  // Finish
00168 
00169 
00171 
00174 
00183     static BIGNUM * b642BN(char * b64in, unsigned int len);
00184 
00186 
00187 private :
00188 
00189     EVP_ENCODE_CTX m_ectx;              // Encode context
00190     EVP_ENCODE_CTX m_dctx;              // Decode context
00191 
00192 };
00193 
00194 /*\@}*/
00195 
00196 #endif /* HAVE_OPENSSL */
00197 #endif /* OPENSSLCRYPTOBASE64_INCLUDE */

Generated on Sun Jul 3 17:37:26 2005 for XML-Security-C by  doxygen 1.4.2