Skip to main content

ERUCES::TEAgentFile

#include <teagent.h>

The TEAgentFile class encrypts and decrypts file data.

Inheritance

Public Types

enum CRYPTO_LOCATION

File crypto processing location enumation.

ValueDescription
ENGINEfile processed on client engine side
AGENTfile processed on agent side

Private Attrib

TypeNameDescription
void *m_pFile

Public Member Functions

MemberDescription
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() constThe 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() constThe 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() constThe 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() constThe 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() constThe isCompressionEnabled method checks whether data compression has been enabled.
_TESTD string getTempPath() constThe 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() constThe 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() constThe 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() constThe 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) constThe 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() constThe 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

ParameterDescription
sizeAn 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

ParameterDescription
flagShredding 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

ParameterDescription
locThe 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:

  1. This flag is only useful for encryption.
  2. 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

ParameterDescription
checkA 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

ParameterDescription
compressA 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

ParameterDescription
pathA 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

ParameterDescription
nameA 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

ParameterDescription
poAn 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

ParameterDescription
nameA string representing the name of a destination file.

_TESTD string getHiddenLink(bool encode=true) const

The getHiddenLink method gets a TTag.

Parameters

ParameterDescription
encodeEncoding 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

ParameterDescription
hlA string representing a TTag.
decodeDecoding 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

ParameterDescription
eFile 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.