Google APIs Client Library for C++
OpenSslCodec Class Reference

Provdes a codec for encrypting and decrypting reader streams using OpenSSL. More...

#include "client/data/openssl_codec.h"

+ Inheritance diagram for OpenSslCodec:

List of all members.

Public Member Functions

 OpenSslCodec ()
 Standard constructor.
virtual ~OpenSslCodec ()
 Standard destructor.
void set_chunk_size (int chunk_size)
 Sets the chunk size to use when encoding/decoding.
util::Status Init (const EVP_CIPHER *cipher_type, const string &key, const string &iv)
 Initializes with the cipher type, key, and initialization vector.
virtual DataReaderNewManagedEncodingReader (DataReader *reader, Closure *deleter, util::Status *status)
 Returns a reader that will encode another reader using this codec.
virtual DataReaderNewManagedDecodingReader (DataReader *reader, Closure *deleter, util::Status *status)
 Returns a reader that will decode another reader using this codec.

Detailed Description

Provdes a codec for encrypting and decrypting reader streams using OpenSSL.

See also:
OpenSslCodecFactory

Constructor & Destructor Documentation

Standard constructor.

See also:
Init
virtual ~OpenSslCodec ( ) [virtual]

Standard destructor.


Member Function Documentation

util::Status Init ( const EVP_CIPHER *  cipher_type,
const string &  key,
const string &  iv 
)

Initializes with the cipher type, key, and initialization vector.

Parameters:
[in]cipher_typeOpenSsl cipher type.
[in]keyThe cipher key.
[in]ivThe cipher initialization vector.
Returns:
ok or reason for failure.
virtual DataReader* NewManagedDecodingReader ( DataReader reader,
Closure *  deleter,
util::Status status 
) [virtual]

Returns a reader that will decode another reader using this codec.

Parameters:
[in]readerThe caller maintain ownership.
[in]deleterThe managed deleter may be used to delete the reader. NULL indicates an unmanaged reader.
[out]statusWill indicate ok or reason for failure.
Returns:
The reader may be an InvalidDataReader on failure but will not be NULL.

Implements Codec.

virtual DataReader* NewManagedEncodingReader ( DataReader reader,
Closure *  deleter,
util::Status status 
) [virtual]

Returns a reader that will encode another reader using this codec.

Parameters:
[in]readerThe caller maintain ownership.
[in]deleterThe managed deleter may be used to delete the reader. NULL indicates an unmanaged reader.
[out]statusWill indicate ok or reason for failure.
Returns:
The reader may be an InvalidDataReader on failure but will not be NULL.

Implements Codec.

void set_chunk_size ( int  chunk_size) [inline]

Sets the chunk size to use when encoding/decoding.

Parameters:
[in]chunk_sizeMust be > 0 and should be a multiple of the cipher block size.

There is probably no need for changing this, but helps testing.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines