Bayonne2 / Common C++ 2 Framework
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes
AlgorithmEnum Class Reference

The algorithm enumration class. More...

#include <ZrtpConfigure.h>

Collaboration diagram for AlgorithmEnum:
Collaboration graph
[legend]

Public Member Functions

 AlgorithmEnum (const AlgoTypes type, const char *name, int32_t klen, const char *ra, encrypt_t en, decrypt_t de, SrtpAlgorithms alId)
 Create an AlgorithmEnum object. More...
 
 ~AlgorithmEnum ()
 AlgorithmEnum destructor. More...
 
const char * getName ()
 Get the algorihm's name. More...
 
const char * getReadable ()
 Get the algorihm's readable name. More...
 
int getKeylen ()
 Get the algorihm's key length. More...
 
SrtpAlgorithms getAlgoId ()
 Get the algorihm's integer id. More...
 
encrypt_t getEncrypt ()
 Get the algorihm's key length. More...
 
decrypt_t getDecrypt ()
 Get the algorihm's key length. More...
 
AlgoTypes getAlgoType ()
 Get the algorithm type of this AlgorithmEnum object. More...
 
bool isValid ()
 Check if this AlgorithmEnum object is valid. More...
 

Private Attributes

AlgoTypes algoType
 
std::string algoName
 
int32_t keyLen
 
std::string readable
 
encrypt_t encrypt
 
decrypt_t decrypt
 
SrtpAlgorithms algoId
 

Detailed Description

The algorithm enumration class.

This simple class is just a container of an algorithm's name and its associated algorithm type. We use this class together with the EnumBase class to implement a Java-like enum class functionality (not fully, but OK for our use case).

An application shall use the get / check methods to retrieve information.

Definition at line 62 of file ZrtpConfigure.h.

Constructor & Destructor Documentation

AlgorithmEnum::AlgorithmEnum ( const AlgoTypes  type,
const char *  name,
int32_t  klen,
const char *  ra,
encrypt_t  en,
decrypt_t  de,
SrtpAlgorithms  alId 
)

Create an AlgorithmEnum object.

Parameters
typeDefines the algorithm type
nameSet the names of the algorithm. The name is copied and the call may reuse the space.
klenThe key length for this algorihm in byte, for example 16 or 32
raA human readable short string that describes the algorihm.
enPointer to the encryption function of this algorithn
dePointer to the decryption funtions of this algorithm.
alIdThe algorithm id used by SRTP to identify an algorithm type, for example Skein, Sha1, Aes, ...
See Also
AlgoTypes
AlgorithmEnum::~AlgorithmEnum ( )

AlgorithmEnum destructor.

Member Function Documentation

SrtpAlgorithms AlgorithmEnum::getAlgoId ( )

Get the algorihm's integer id.

Returns
An integer that defines the algorithm.
AlgoTypes AlgorithmEnum::getAlgoType ( )

Get the algorithm type of this AlgorithmEnum object.

Returns
The algorithm type.
See Also
AlgoTypes
decrypt_t AlgorithmEnum::getDecrypt ( )

Get the algorihm's key length.

Returns
An integer definig the key length in bytes.
encrypt_t AlgorithmEnum::getEncrypt ( )

Get the algorihm's key length.

Returns
An integer definig the key length in bytes.
int AlgorithmEnum::getKeylen ( )

Get the algorihm's key length.

Returns
An integer definig the key length in bytes.
const char* AlgorithmEnum::getName ( )

Get the algorihm's name.

Returns
Algorithm's name as null terminated C-string. The application must not free this memory.
const char* AlgorithmEnum::getReadable ( )

Get the algorihm's readable name.

Returns
Algorithm's readable name as null terminated C-string. The application must not free this memory.
bool AlgorithmEnum::isValid ( )

Check if this AlgorithmEnum object is valid.

Returns
true if the object is valid, false otherwise

Field Documentation

SrtpAlgorithms AlgorithmEnum::algoId
private

Definition at line 168 of file ZrtpConfigure.h.

std::string AlgorithmEnum::algoName
private

Definition at line 163 of file ZrtpConfigure.h.

AlgoTypes AlgorithmEnum::algoType
private

Definition at line 162 of file ZrtpConfigure.h.

decrypt_t AlgorithmEnum::decrypt
private

Definition at line 167 of file ZrtpConfigure.h.

encrypt_t AlgorithmEnum::encrypt
private

Definition at line 166 of file ZrtpConfigure.h.

int32_t AlgorithmEnum::keyLen
private

Definition at line 164 of file ZrtpConfigure.h.

std::string AlgorithmEnum::readable
private

Definition at line 165 of file ZrtpConfigure.h.


The documentation for this class was generated from the following file: