libDwmAuth-0.3.6
Dwm::XChaCha20Poly1305::OutBuffer Class Reference

This class is a helper for encrypted stream output. More...

#include <DwmXChaCha20Poly1305OutBuffer.hh>

Inherits streambuf.

Public Member Functions

 OutBuffer (std::ostream &os, const std::string &key)
 Construct with the given ostream os and encryption key key.
 

Protected Member Functions

int_type overflow (int_type c) override
 
int sync () override
 
std::streamsize xsputn (const char *p, std::streamsize n) override
 

Detailed Description

This class is a helper for encrypted stream output.

It is used as a streambuf for an ostream. It will buffer internally until flush() is called on the ostream that owns the buffer (which will end up calling our sync() member). When our sync() member is called, we will write a random nonce (initialization vector), the encrypted data and the MAC to the associated ostream that was passed as the first argument of the constructor. In other words, message packaging and transmission occurs whenever our sync() member is called.

This class is typically not used directly, but is instead instantiated by Dwm::XChaCha20Poly1305::Ostream.


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