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

Keepass2 database file representation. More...

#include <kdbx.hh>

Public Member Functions

std::unique_ptr< Database > Import (const std::string &path, const Key &key)
 Imports a KDBX database from a file path.
 
std::unique_ptr< Database > Import (std::istream &src, const Key &key)
 Imports a KDBX database from an input stream.
 
void Export (const std::string &path, const Database &db, const Key &key)
 Exports a database to a KDBX file.
 
void Export (std::ostream &dst, const Database &db, const Key &key)
 Exports a database to an output stream in KDBX format.
 
void set_write_kdbx4 (bool write_kdbx4)
 
void set_use_cached_key (bool use_cached_key)
 
bool use_cached_key () const
 
void set_resource_limits (const detail::ResourceLimits &limits)
 

Detailed Description

Keepass2 database file representation.

Member Function Documentation

◆ Export() [1/2]

void keepass::KdbxFile::Export ( const std::string &  path,
const Database &  db,
const Key &  key 
)

Exports a database to a KDBX file.

Parameters
pathPath to the output file.
dbThe database to export.
keyThe key used to encrypt the database.

◆ Export() [2/2]

void keepass::KdbxFile::Export ( std::ostream &  dst,
const Database &  db,
const Key &  key 
)

Exports a database to an output stream in KDBX format.

Parameters
dstThe output stream to write the KDBX database to.
dbThe database to export.
keyThe key used to encrypt the database.

◆ Import() [1/2]

std::unique_ptr< Database > keepass::KdbxFile::Import ( const std::string &  path,
const Key &  key 
)

Imports a KDBX database from a file path.

Parameters
pathPath to the KDBX database file on disk.
keyThe key used to decrypt the database.
Returns
A unique pointer to the imported Database object.

◆ Import() [2/2]

std::unique_ptr< Database > keepass::KdbxFile::Import ( std::istream &  src,
const Key &  key 
)

Imports a KDBX database from an input stream.

Parameters
srcThe input stream containing the KDBX database.
keyThe key used to decrypt the database.
Returns
A unique pointer to the imported Database object.

◆ set_resource_limits()

void keepass::KdbxFile::set_resource_limits ( const detail::ResourceLimits &  limits)

Sets the resource budgets enforced while importing and parsing.

◆ set_use_cached_key()

void keepass::KdbxFile::set_use_cached_key ( bool  use_cached_key)
inline

Selects whether a transformed key cached on the Database may be reused. Callers that explicitly supply a key (for example SaveAs/re-encryption) must disable this so that the supplied key actually replaces the cached one. Enabled by default, so keyless saves of freshly created or imported databases can reuse the cache.

◆ set_write_kdbx4()

void keepass::KdbxFile::set_write_kdbx4 ( bool  write_kdbx4)
inline

Forces the exporter to produce a KDBX 4 format database.

◆ use_cached_key()

bool keepass::KdbxFile::use_cached_key ( ) const
inline

Returns whether a cached transformed key may be reused.


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