AWS SDK for C++AWS SDK for C++ Version 1.11.788 |
#include <CryptoBuf.h>
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.
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
Definition at line 71 of file CryptoBuf.h.
This call isn't necessary if you loop over the stream.read 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.
std::ios_base::in|std::ios_base::out
std::ios_base::in|std::ios_base::out