Google APIs Client Library for C++
OpenSslCodecFactory Class Reference

CodecFactory for creating and configuring OpenSslCodecs. More...

#include "client/data/openssl_codec.h"

+ Inheritance diagram for OpenSslCodecFactory:

List of all members.

Public Member Functions

 OpenSslCodecFactory ()
 Standard constructor.
 ~OpenSslCodecFactory ()
 Standard destructor.
void set_cipher_type (const EVP_CIPHER *type)
 Sets the cipher_type for new codecs.
void set_md (EVP_MD *md)
 Sets the message digest algorithm for new codecs.
void set_salt (const StringPiece &data)
 Sets the salt value to configure the algorithms with.
void set_chunk_size (int chunk_size)
 Sets the chunk size to use when encoding/decoding.
util::Status SetPassphrase (const StringPiece &passphrase)
 Computes the key and initialization vector from a passphrase.
virtual CodecNew (util::Status *status)
 Constructs and configures a new codec instance.

Detailed Description

CodecFactory for creating and configuring OpenSslCodecs.

To configure creted ciphers, set the type, md, and aalt.


Constructor & Destructor Documentation

Standard constructor.

Standard destructor.


Member Function Documentation

virtual Codec* New ( util::Status status) [virtual]

Constructs and configures a new codec instance.

Parameters:
[out]statusok or reason for failure.
Returns:
NULL on failure.

Implements CodecFactory.

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.

void set_cipher_type ( const EVP_CIPHER *  type) [inline]

Sets the cipher_type for new codecs.

This interface does not currently provide access to EVP_CIPHER_CTX_ctrl so RC5 and RC2 might not be viable options without further enhacement.

Parameters:
[in]typeThe OpenSsl cipher type.
void set_md ( EVP_MD *  md) [inline]

Sets the message digest algorithm for new codecs.

Parameters:
[in]mdThe OpenSsl message digest algorithm.
void set_salt ( const StringPiece &  data) [inline]

Sets the salt value to configure the algorithms with.

Parameters:
[in]dataThe salt value to use should be exactly 8 bytes.
util::Status SetPassphrase ( const StringPiece &  passphrase)

Computes the key and initialization vector from a passphrase.

Parameters:
[in]passphraseThe passphrase to use.
Returns:
ok or reason for failure.

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