ERUCES::TEAgent
#include <teagent.h>
The TEAgent class represents the Key Service Agent and forms the base class of the TEAgentMatrix and TEAgentFile classes.
Inheritance
- Inherited by ERUCES::TEAgentFile
- Inherited by ERUCES::TEAgentMatrix
- Inherited by ERUCES::TEKey
Protected Attributes
| Type | Name | Description |
|---|---|---|
| bool | m_bEncode | |
| bool | m_bDecode | |
| bool | m_bAlloc | |
| void * | m_matrix | |
| void * | m_pConn | |
| void * | m_pCProv | |
| void * | m_pHash | |
| void * | m_pTEConn | |
| void * | m_pCipher |
Public Member Functions
| Member | Description |
|---|---|
TEAgent() | The TEAgent constructor is the default class constructor. |
~TEAgent() | The TEAgent destructor is the class destructor. |
void setEncodeMode(bool encode) | The setEncodeMode method sets the encode mode, which determines whether the output data will be Base64 encoded. |
bool getEncodeMode() | The getEncodeMode method gets the encode mode currently in use. |
void setDecodeMode(bool decode) | The setDecodeMode method sets the decode mode, which indicates whether the input data will be Base64 decoded. |
bool getDecodeMode() | The getDecodeMode method gets the decode mode currently in use. |
void setCipher(TECipher *cipher) | The setCipher method sets the cipher object. All encryption and decryption will be performed inside agent. |
const TECipher * getCipher() const | The getCipher gets the cipher object. |
void attachConnection(uint32_t handle) | The attachConnection method attaches to a connection specified by a connection handle. |
void attachConnection(const TEConnection *conn) | The attachConnection method attaches to a connection specified by a TEConnection pointer. |
uint32_t detachConnection() | The detachConnection method detaches a connection. |
void encrypt() | The encrypt method encrypts data. |
void decrypt() | The decrypt method decrypts data. |
void encryptData(_TESTD string &data, _TESTD string &hl, const _TESTD string &iv) | The encryptData method encrypts data using a specified TTag and IV. |
void decryptData(_TESTD string &data, const _TESTD string &hl, const _TESTD string &iv) | The decryptData method decrypts data using a specified TTag and initialization vector. |
void decryptData(_TESTD string &data, const _TESTD string &hl, uint32_t less) | The decryptData method decrypts data using a specified TTag and initialization vector. |
uint32_t performHash(_TESTD vector< _TESTD pair< _TESTD string, _TESTD string > > &data) const | The performHash method hashes data. |
void clear() | The clear method clears all internal status data. |
void reset() | The reset method clears all internal status data and detaches the connection. |
_TESTD auto_ptr< TEAgent > clone() const | The clone method clones a TEAgent object. |
Protected Member Functions
| Member | Description |
|---|---|
void processData(long fid, char id, _TESTD string &data, _TESTD string &hl, const _TESTD string &iv, bool bHLDecode=false, bool bHLEncode=false) | The processData method processes data (for internal use only). |
Member Function Documentation
TEAgent()
The TEAgent constructor is the default class constructor.
~TEAgent()
The TEAgent destructor is the class destructor.
void setEncodeMode(bool encode)
The setEncodeMode method sets the encode mode, which determines whether the output data will be Base64 encoded.
Parameters
| Parameter | Description |
|---|---|
encode | A boolean value indicating whether the output data will be Base64 encoded; True = output will be Base64 encoded, False = output will not be Base64 encoded. |
bool getEncodeMode()
The getEncodeMode method gets the encode mode currently in use.
Returns: Returns a boolean value representing whether the Base64 encoding is in use; True = Base64 encoding is in use, False = Base64 encoding is not in use.
void setDecodeMode(bool decode)
The setDecodeMode method sets the decode mode, which indicates whether the input data will be Base64 decoded.
Parameters
| Parameter | Description |
|---|---|
decode | A boolean value indicating whether the input data will be Base64 decoded; True = input will be Base64 decoded, False = input will not be Base64 decoded. |
bool getDecodeMode()
The getDecodeMode method gets the decode mode currently in use.
Returns: Returns a boolean value representing whether Base64 decoding is in use; True = Base64 decoding is in use, False = Base64 decoding is not in use.
void setCipher(TECipher *cipher)
The setCipher method sets the cipher object. All encryption and decryption will be performed inside agent.
Parameters
| Parameter | Description |
|---|---|
cipher | Cipher object |
const TECipher * getCipher() const
The getCipher gets the cipher object.
Returns: Returns a pointer to cipher object
void attachConnection(uint32_t handle)
The attachConnection method attaches to a connection specified by a connection handle.
Parameters
| Parameter | Description |
|---|---|
handle | A 32-bit unsigned integer representing a connection handle for an existing connection. |
void attachConnection(const TEConnection *conn)
The attachConnection method attaches to a connection specified by a TEConnection pointer.
Parameters
| Parameter | Description |
|---|---|
conn | A constant pointer to an existing TEConnection object. |
uint32_t detachConnection()
The detachConnection method detaches a connection.
Returns: Returns an unsigned 32-bit integer representing the connection handle of the detached connection.
void encrypt()
The encrypt method encrypts data.
void decrypt()
The decrypt method decrypts data.
void encryptData(_TESTD string &data, _TESTD string &hl, const _TESTD string &iv)
The encryptData method encrypts data using a specified TTag and IV.
Parameters
| Parameter | Description |
|---|---|
data | A string of data; input is to be encrypted, output has been encrypted. |
hl | A constant string representing a TTag to be used for encryption. |
iv | A constant string representing an IV to be used for encryption. |
void decryptData(_TESTD string &data, const _TESTD string &hl, const _TESTD string &iv)
The decryptData method decrypts data using a specified TTag and initialization vector.
Parameters
| Parameter | Description |
|---|---|
data | A string of data; input is to be decrypted, output has been decrypted. |
hl | A constant string representing a TTag to be used for decryption. |
iv | A constant string representing an IV to be used for decryption. |
void decryptData(_TESTD string &data, const _TESTD string &hl, uint32_t less)
The decryptData method decrypts data using a specified TTag and initialization vector.
Parameters
| Parameter | Description |
|---|---|
data | A string of data; input is to be decrypted, output has been decrypted. |
hl | A constant string representing a TTag to be used for decryption. |
less | An integer representing . |
uint32_t performHash(_TESTD vector< _TESTD pair< _TESTD string, _TESTD string > > &data) const
The performHash method hashes data.
The hash method is SHA -
Parameters
| Parameter | Description |
|---|---|
data | A vector of string pairs. Input: First string is data to be hashed, second string is salt to be used; Output: First string is hashed value, second string is unchanged. |
Returns: Return value represents the size of a vector.
void clear()
The clear method clears all internal status data.
void reset()
The reset method clears all internal status data and detaches the connection.
_TESTD auto_ptr< TEAgent > clone() const
The clone method clones a TEAgent object.
Returns: Returns a smart pointer to a new TEAgent object.
void processData(long fid, char id, _TESTD string &data, _TESTD string &hl, const _TESTD string &iv, bool bHLDecode=false, bool bHLEncode=false)
The processData method processes data (for internal use only).
Parameters
| Parameter | Description |
|---|---|
fid | Function ID |
id | operation ID |
data | String of data to be processed |
hl | A string representing the TTag |
iv | String of IV |
bHLDecode | Decoding TTag for input |
bHLEncode | Encoding TTag for output |