ERUCES::TEAgentFile
#include <teagent.h>
The TEAgentFile class encrypts and decrypts file data.
Inheritance
- Inherits ERUCES::TEAgent
Public Types
enum CRYPTO_LOCATION
File crypto processing location enumation.
| Value | Description |
|---|---|
ENGINE | file processed on client engine side |
AGENT | file processed on agent side |
Private Attrib
| Type | Name | Description |
|---|---|---|
| void * | m_pFile |
Public Member Functions
| Member | Description |
|---|---|
TEAgentFile() | The TEAgent constructor is the default constructor for the TEAgentFile class. |
~TEAgentFile() | The TEAgent destructor is the destructor for the TEAgentFile class. |
uint32_t getChunkSize() const | The getChunkSize method gets the size of each multi-byte data chunk(in K bytes). Note: File is processed in chunks. The default chunk size is 50K. |
void setChunkSize(uint32_t size) | The setChunkSize method sets the size of each multi-byte data chunk(in K bytes). |
void setShredding(bool flag) | The setShredding method sets file shredding flag. |
bool getShredding() const | The getShredding method retrieves the file shredding flag. |
void setCryptoLocation(CRYPTO_LOCATION loc) | The setCryptoLocation method sets the location where a file's cryptographic processes are performed. |
CRYPTO_LOCATION getCryptoLocation() const | The getCryptoLocation method gets the location where a file's cryptographic processes are performed. |
void enableIntegrityCheck(bool check) | The enableIntegrityCheck method enables or disables the file integrity check. |
bool isIntegrityCheckEnabled() const | The isIntegrityCheckEnabled method checks whether the file integrity check has been enabled. |
void enableCompression(bool compress) | The enableCompression method enables or disables file compression. Note: This flag is only useful for encryption. |
bool isCompressionEnabled() const | The isCompressionEnabled method checks whether data compression has been enabled. |
_TESTD string getTempPath() const | The getTempPath method gets a file temporary path. |
void setTempPath(const _TESTD string path) | The setTemporaryPath method sets a file's temporary path. |
_TESTD string getInputFileName() const | The getInputFileName method gets the file name to be processed. |
void setInputFileName(const _TESTD string &name) | The setInputFileName method sets the file name to be processed. |
uint64_t getStartPosition() const | The getStartPosition method retrieves the file position to start processing. |
void setStartPosition(const uint64_t po) | The setStartPosition method set file position to start processing. |
_TESTD string getOutputFileName() const | The getOutputFileName method retrieves the output file name. |
void setOutputFileName(const _TESTD string &name) | The setOutputFileName method sets the output file name. |
_TESTD string getHiddenLink(bool encode=true) const | The getHiddenLink method gets a TTag. |
void setHiddenLink(const _TESTD string &hl, bool decode=true) | The setHiddenLink method sets the TTag information. |
void encrypt() | The encrypt method encrypts a file. |
void decrypt() | The decrypt method decrypts a file. |
void setNotify(TEAgentFileEvent *e) | The setNotify method sets the notification event. |
_TESTD auto_ptr< TEAgent > clone() const | The clone method clones this file process object. |
void clear() | The clear method clears all interal status. All attributes will be set to default value. |
Member Function Documentation
TEAgentFile()
The TEAgent constructor is the default constructor for the TEAgentFile class.
~TEAgentFile()
The TEAgent destructor is the destructor for the TEAgentFile class.
uint32_t getChunkSize() const
The getChunkSize method gets the size of each multi-byte data chunk(in K bytes). Note: File is processed in chunks. The default chunk size is 50K.
Returns: Returns an integer representing the size of each chunk in K bytes.
void setChunkSize(uint32_t size)
The setChunkSize method sets the size of each multi-byte data chunk(in K bytes).
Parameters
| Parameter | Description |
|---|---|
size | An integer representing the size of a data chunk in K bytes. |
void setShredding(bool flag)
The setShredding method sets file shredding flag.
True-shred/False-not shred. Original plain-text file and temporary file can be shredded if this flag is set. Note: By setting shredding flag to true, file process time will be longer than non-shredding process.
Parameters
| Parameter | Description |
|---|---|
flag | Shredding flag: true-shred/false-not shred. |
bool getShredding() const
The getShredding method retrieves the file shredding flag.
Returns: File shredding flag. True-Shred/False-Not shred.
void setCryptoLocation(CRYPTO_LOCATION loc)
The setCryptoLocation method sets the location where a file's cryptographic processes are performed.
Parameters
| Parameter | Description |
|---|---|
loc | The location where a file's cryptographic processes occur; Agent = TE Agent, Engine = Remote Engine. |
See also: CRYPTO_LOCATION
CRYPTO_LOCATION getCryptoLocation() const
The getCryptoLocation method gets the location where a file's cryptographic processes are performed.
Returns: Returns a CryptoLocation object.
void enableIntegrityCheck(bool check)
The enableIntegrityCheck method enables or disables the file integrity check.
By setting integrity check, during encryption, integrity check value is calculated and saved together with encrypted file. During decryption, integrity check is performed automatically if the integrity check is performed during encryption. Note:
- This flag is only useful for encryption.
- If this flag is set, encryption will be slower. check A boolean value indicating whether the file integrity check has been enabled; True = file integrity check is enabled, False = file integrity check is disabled.
Parameters
| Parameter | Description |
|---|---|
check | A boolean value indicating whether the file integrity check has been enabled; True = file integrity check is enabled, False = file integrity check is disabled. |
bool isIntegrityCheckEnabled() const
The isIntegrityCheckEnabled method checks whether the file integrity check has been enabled.
Returns: Returns a boolean value indicating whether the file integrity check has been enabled; True = the file integrity check is enabled, False = the file integrity check is disabled.
void enableCompression(bool compress)
The enableCompression method enables or disables file compression. Note: This flag is only useful for encryption.
Parameters
| Parameter | Description |
|---|---|
compress | A boolean value indicating whether file compression has been enabled; True = file compression is enabled, False = file compression is disabled. |
bool isCompressionEnabled() const
The isCompressionEnabled method checks whether data compression has been enabled.
Returns: Returns a boolean value indicating whether file compression has been enabled; True = file compression is enabled, False = file compression is disabled.
_TESTD string getTempPath() const
The getTempPath method gets a file temporary path.
Returns: Returns a string representing a file's temporary path.
void setTempPath(const _TESTD string path)
The setTemporaryPath method sets a file's temporary path.
Parameters
| Parameter | Description |
|---|---|
path | A string representing a file's temporary path. |
_TESTD string getInputFileName() const
The getInputFileName method gets the file name to be processed.
Returns: Returns a string representing the name of a source file.
void setInputFileName(const _TESTD string &name)
The setInputFileName method sets the file name to be processed.
Parameters
| Parameter | Description |
|---|---|
name | A string representing the name of a source file. |
uint64_t getStartPosition() const
The getStartPosition method retrieves the file position to start processing.
Returns: An integer representing the file position to start processing.
void setStartPosition(const uint64_t po)
The setStartPosition method set file position to start processing.
Parameters
| Parameter | Description |
|---|---|
po | An integer representing the file position to start processing. |
_TESTD string getOutputFileName() const
The getOutputFileName method retrieves the output file name.
Returns: Returns a string representing the name of a destination file.
void setOutputFileName(const _TESTD string &name)
The setOutputFileName method sets the output file name.
Parameters
| Parameter | Description |
|---|---|
name | A string representing the name of a destination file. |
_TESTD string getHiddenLink(bool encode=true) const
The getHiddenLink method gets a TTag.
Parameters
| Parameter | Description |
|---|---|
encode | Encoding flag. True- TTag data is in base64 encoded format/False- TTag data is not encoded. Default value is true-base 64 encoded. |
Returns: String represent a TTag.
void setHiddenLink(const _TESTD string &hl, bool decode=true)
The setHiddenLink method sets the TTag information.
Parameters
| Parameter | Description |
|---|---|
hl | A string representing a TTag. |
decode | Decoding flag. True- TTag data is in base64 encoded format/False- TTag data is not encoded. |
void encrypt()
The encrypt method encrypts a file.
Remark: Overrides the encrypt method in the TEAgent class.
void decrypt()
The decrypt method decrypts a file.
Remark: Overrides the decrypt method in the TEAgent class.
void setNotify(TEAgentFileEvent *e)
The setNotify method sets the notification event.
Parameters
| Parameter | Description |
|---|---|
e | File process event. |
_TESTD auto_ptr< TEAgent > clone() const
The clone method clones this file process object.
Returns: Cloned object.
void clear()
The clear method clears all interal status. All attributes will be set to default value.