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

OpenSSLCryptoBase64 Class Reference
[OpenSSL Interface]

#include <OpenSSLCryptoBase64.hpp>

Inheritance diagram for OpenSSLCryptoBase64:

Inheritance graph
[legend]
Collaboration diagram for OpenSSLCryptoBase64:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base64 encode/decode handler interface class.

The XSEC library will use implementations of this interface for translating bytes to/from base64 encoding.

Uses the EVP decode/encode routines in OpenSSL to perform the work.

Note:
Requires implementation of OpenSSL > 0.9.6e as there was a bug in the Base64 decoding routines in this version and prior.


Public Member Functions

 OpenSSLCryptoBase64 ()
virtual ~OpenSSLCryptoBase64 ()
Decoding Functions
virtual void decodeInit (void)
 Initialise the base64 object.
virtual unsigned int decode (const unsigned char *inData, unsigned int inLength, unsigned char *outData, unsigned int outLength)
 Decode some passed in data.
virtual unsigned int decodeFinish (unsigned char *outData, unsigned int outLength)
 Finish off a decode.
Encoding Functions
virtual void encodeInit (void)
 Initialise the base64 object for encoding.
virtual unsigned int encode (const unsigned char *inData, unsigned int inLength, unsigned char *outData, unsigned int outLength)
 Encode some passed in data.
virtual unsigned int encodeFinish (unsigned char *outData, unsigned int outLength)
 Finish off an encode.

Static Public Member Functions

Library Specific Functions
static BIGNUM * b642BN (char *b64in, unsigned int len)
 Translate a base64 encoded BN to a bignum.


Constructor & Destructor Documentation

OpenSSLCryptoBase64::OpenSSLCryptoBase64  )  [inline]
 

virtual OpenSSLCryptoBase64::~OpenSSLCryptoBase64  )  [inline, virtual]
 


Member Function Documentation

static BIGNUM* OpenSSLCryptoBase64::b642BN char *  b64in,
unsigned int  len
[static]
 

Translate a base64 encoded BN to a bignum.

Take a ds:CryptoBinary number and translate to an OpenSSL representation of a "big number" BIGNUM.

virtual unsigned int OpenSSLCryptoBase64::decode const unsigned char *  inData,
unsigned int  inLength,
unsigned char *  outData,
unsigned int  outLength
[virtual]
 

Decode some passed in data.

Pass the encoded data through the OpenSSL base64 decode function and place the data in the outData buffer.

Note:
The OpenSSL library is very unkind if the output buffer is not large enough. It is the responsibility of the caller to ensure the buffer will take the data.
Parameters:
inData Pointer to the buffer holding encoded data.
inLength Length of the encoded data in the buffer
outData Buffer to place decoded data into
outLength Maximum amount of data that can be placed in the buffer.
Returns:
The number of bytes placed in the outData buffer.

Implements XSECCryptoBase64.

virtual unsigned int OpenSSLCryptoBase64::decodeFinish unsigned char *  outData,
unsigned int  outLength
[virtual]
 

Finish off a decode.

Clean out any extra data in the OpenSSL decode context variable into the outData buffer.

Parameters:
outData Buffer to place any remaining decoded data
outLength Max amount of data to be placed in the buffer.
Returns:
Amount of data placed in the outData buffer

Implements XSECCryptoBase64.

virtual void OpenSSLCryptoBase64::decodeInit void   )  [virtual]
 

Initialise the base64 object.

Initialises the OpenSSL decode context and gets ready for data to be decoded.

Implements XSECCryptoBase64.

virtual unsigned int OpenSSLCryptoBase64::encode const unsigned char *  inData,
unsigned int  inLength,
unsigned char *  outData,
unsigned int  outLength
[virtual]
 

Encode some passed in data.

Pass the data through the OpenSSL Base64 encoder and place the output in the outData buffer. Will keep any "overhang" data in the context buffer ready for the next pass of input data.

Parameters:
inData Pointer to the buffer holding data to be encoded.
inLength Length of the data in the buffer
outData Buffer to place encoded data into
outLength Maximum amount of data that can be placed in the buffer.
Returns:
The number of bytes placed in the outData buffer.

Implements XSECCryptoBase64.

virtual unsigned int OpenSSLCryptoBase64::encodeFinish unsigned char *  outData,
unsigned int  outLength
[virtual]
 

Finish off an encode.

Take any data left in the context variable, and create the tail of the base64 encoding.

Parameters:
outData Buffer to place any remaining encoded data
outLength Max amount of data to be placed in the buffer.
Returns:
Amount of data placed in the outData buffer

Implements XSECCryptoBase64.

virtual void OpenSSLCryptoBase64::encodeInit void   )  [virtual]
 

Initialise the base64 object for encoding.

Get the context variable ready for a base64 decode

Implements XSECCryptoBase64.


The documentation for this class was generated from the following file:
Generated on Sun Jul 3 17:41:54 2005 for XML-Security-C by  doxygen 1.4.2