This class is essentially a filter for an istream. More...
#include <DwmXChaCha20Poly1305Istream.hh>
Inherits std::istream.
Public Member Functions | |
| Istream (std::istream &is, const std::string &key) | |
Construct with a reference to an existing encrypted istream is and a 32-byte shared secret key which will be used to decrypt the contents of is. More... | |
| virtual | ~Istream () |
| Destructor. | |
This class is essentially a filter for an istream.
It allows the user of this class to read and decrypt an encrypted stream, hiding all the details of decryption. Think of it as a decrypting proxy for any istream that sources encrypted data.
Since the C++ standard library does not include any socket abstractions, the first argument to the constructor of this class is usually an asio::ip::tcp::iostream (in the boost namespace if you're using asio as bundled in Boost instead of standalone). It might also be an ifstream if we're reading encrypted data at rest.
Note how tiny this code is; all of the real extensibility is in the std::streambuf, per the design of C++ iostreams.
|
inline |
Construct with a reference to an existing encrypted istream is and a 32-byte shared secret key which will be used to decrypt the contents of is.