AWS SDK for C++  1.9.153
AWS SDK for C++
Public Member Functions | Protected Member Functions | List of all members
Aws::Utils::Crypto::SymmetricCryptoBufSrc Class Reference

#include <CryptoBuf.h>

+ Inheritance diagram for Aws::Utils::Crypto::SymmetricCryptoBufSrc:

Public Member Functions

 SymmetricCryptoBufSrc (Aws::IStream &stream, SymmetricCipher &cipher, CipherMode cipherMode, size_t bufferSize=DEFAULT_BUF_SIZE)
 SymmetricCryptoBufSrc (const SymmetricCryptoBufSrc &)=delete
 SymmetricCryptoBufSrc (SymmetricCryptoBufSrc &&)=delete
SymmetricCryptoBufSrcoperator= (const SymmetricCryptoBufSrc &)=delete
SymmetricCryptoBufSrcoperator= (SymmetricCryptoBufSrc &&)=delete
virtual ~SymmetricCryptoBufSrc ()
void Finalize () override
- Public Member Functions inherited from Aws::Utils::Crypto::CryptoBuf
 CryptoBuf ()=default
virtual ~CryptoBuf ()=default
 CryptoBuf (const CryptoBuf &)=delete
 CryptoBuf (CryptoBuf &&rhs)=delete

Protected Member Functions

pos_type seekoff (off_type off, std::ios_base::seekdir dir, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override
pos_type seekpos (pos_type pos, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out) override

Detailed Description

StreamBuf that takes data from an input stream, encrypts or decrypts it, and causes all input received from the stream that is using it to go through the cipher. A common use case is a file that is encrypted on disk being read via ifstream and then read decrypted into memory. Or you could send a plain text file through an iostream and have it encrypted when the stream is read.

This streambuf is seekable, but it is very expensive to seek backwards since we have to reset the cipher and re-encrypt everything up to that point. So seeking should be avoided if at all possible.

Definition at line 54 of file CryptoBuf.h.

Constructor & Destructor Documentation

◆ SymmetricCryptoBufSrc() [1/3]

Aws::Utils::Crypto::SymmetricCryptoBufSrc::SymmetricCryptoBufSrc ( Aws::IStream stream,
SymmetricCipher cipher,
CipherMode  cipherMode,
size_t  bufferSize = DEFAULT_BUF_SIZE 

stream to src from cipher to encrypt or decrypt the src stream with mode to use cipher in. Encryption or Decryption buffersize, the size of the src buffers to read at a time. Defaults to 1kb

◆ SymmetricCryptoBufSrc() [2/3]

Aws::Utils::Crypto::SymmetricCryptoBufSrc::SymmetricCryptoBufSrc ( const SymmetricCryptoBufSrc )

◆ SymmetricCryptoBufSrc() [3/3]

Aws::Utils::Crypto::SymmetricCryptoBufSrc::SymmetricCryptoBufSrc ( SymmetricCryptoBufSrc &&  )

◆ ~SymmetricCryptoBufSrc()

virtual Aws::Utils::Crypto::SymmetricCryptoBufSrc::~SymmetricCryptoBufSrc ( )

Definition at line 71 of file CryptoBuf.h.

Member Function Documentation

◆ Finalize()

void Aws::Utils::Crypto::SymmetricCryptoBufSrc::Finalize ( )

This call isn't necessary if you loop over the until you reach EOF, if you happen to read the exact amount as the in memory buffers and finish the stream, but never finish the finalize call you'll need to be sure to call this. This is automatically called by the destructor.

Reimplemented from Aws::Utils::Crypto::CryptoBuf.

Definition at line 78 of file CryptoBuf.h.

◆ operator=() [1/2]

SymmetricCryptoBufSrc& Aws::Utils::Crypto::SymmetricCryptoBufSrc::operator= ( const SymmetricCryptoBufSrc )

◆ operator=() [2/2]

SymmetricCryptoBufSrc& Aws::Utils::Crypto::SymmetricCryptoBufSrc::operator= ( SymmetricCryptoBufSrc &&  )

◆ seekoff()

pos_type Aws::Utils::Crypto::SymmetricCryptoBufSrc::seekoff ( off_type  off,
std::ios_base::seekdir  dir,
std::ios_base::openmode  which = std::ios_base::in|std::ios_base::out 

◆ seekpos()

pos_type Aws::Utils::Crypto::SymmetricCryptoBufSrc::seekpos ( pos_type  pos,
std::ios_base::openmode  which = std::ios_base::in|std::ios_base::out 

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