libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::hmac_istreambuf Class Referencefinal

Input streambuf that reads HMAC-verified, block-structured data (KDBX4 format). More...

#include <stream.hh>

Inheritance diagram for keepass::hmac_istreambuf:

Public Member Functions

 hmac_istreambuf (std::istream &src, const uint8_t *hmac_key)
 Constructs an HMAC-verifying input streambuf.
 
bool BudgetExceeded () const
 Returns true if a resource budget was exceeded while reading.
 
 hmac_istreambuf (std::istream &src, const uint8_t *hmac_key, const detail::ResourceLimits &limits)
 Constructs an HMAC-verifying input streambuf with resource limits.
 
 ~hmac_istreambuf ()
 Zeroizes the stored master HMAC key.
 
int underflow () override
 Reads and HMAC-verifies the next block when the get area is exhausted.
 

Detailed Description

Input streambuf that reads HMAC-verified, block-structured data (KDBX4 format).

Each block is preceded by a 32-byte HMAC-SHA256 computed over the block index, block size, and block data. An empty block (size 0) signals end-of-stream.

Constructor & Destructor Documentation

◆ hmac_istreambuf() [1/2]

keepass::hmac_istreambuf::hmac_istreambuf ( std::istream &  src,
const uint8_t *  hmac_key 
)
inline

Constructs an HMAC-verifying input streambuf.

Parameters
srcThe input stream to read HMAC-protected blocks from.
hmac_keyThe 512-bit master HMAC key.

◆ hmac_istreambuf() [2/2]

keepass::hmac_istreambuf::hmac_istreambuf ( std::istream &  src,
const uint8_t *  hmac_key,
const detail::ResourceLimits &  limits 
)
inline

Constructs an HMAC-verifying input streambuf with resource limits.

Parameters
srcThe input stream to read HMAC-protected blocks from.
hmac_keyThe 512-bit master HMAC key.
limitsThe resource budgets enforced while reading.

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