Skip to main content

ERUCES::TECipherStream

#include <tecipher.h>

The TECipherStream class is an abstract interface for cryptographic stream operations.

The TECipherStream class is used to manage cryptopraphic operations in data stream.

Private Attrib

TypeNameDescription
TECipher &cipher_
std::istream *is_
std::ostream *os_

Public Member Functions

MemberDescription
TECipherStream(TECipher &cipher, std::istream *is=0, std::ostream *os=0)constructor
void istream(std::istream *is)The istream methos sets the input stream.
std::istream * istream()The istream methos retrieves the input stream.
void ostream(std::ostream *os)The ostream method sets the output stream.
std::ostream * ostream()The ostream method gets the output stream.
void read(Data &buf)The read method read data from input stream and update cipher, if EOF is reached cipher is finished.
void write(const Data &buf)The write method processes and writes data into output stream.
void flush()The flush method finishes the cipher and flushes the output stream.
std::streamsize run(std::streamsize bufsize=BUFSIZ)The run method takes an input stream through cipher into output stream.

Private Func

MemberDescription
void read_(Data &buf)
void write_(const Data &buf)
void flush_()

Member Function Documentation

TECipherStream(TECipher &cipher, std::istream *is=0, std::ostream *os=0)

constructor

Parameters

ParameterDescription
cipher- instance of TECipher
is- input stream
os- output stream

void istream(std::istream *is)

The istream methos sets the input stream.

std::istream * istream()

The istream methos retrieves the input stream.

void ostream(std::ostream *os)

The ostream method sets the output stream.

std::ostream * ostream()

The ostream method gets the output stream.

void read(Data &buf)

The read method read data from input stream and update cipher, if EOF is reached cipher is finished.

read data from input stream and update cipher, if EOF is reached cipher is finished

Parameters

ParameterDescription
bufbuffer for input data, set size to expected amount of data

void write(const Data &buf)

The write method processes and writes data into output stream.

Parameters

ParameterDescription
bufoutput data

void flush()

The flush method finishes the cipher and flushes the output stream.

std::streamsize run(std::streamsize bufsize=BUFSIZ)

The run method takes an input stream through cipher into output stream.

Parameters

ParameterDescription
bufsize- internal buffer size for read operation

Returns: total bytes processed