74 KeePass(
const std::string& password,
const std::string& keyfile =
"");
81 std::unique_ptr<Database>
Open(
const std::string& path);
91 std::unique_ptr<Database>
Open(std::istream& src);
103 std::unique_ptr<Database>
Open(
const uint8_t* data, std::size_t size);
106 std::unique_ptr<Database>
Open(
const std::vector<uint8_t>& data) {
107 return Open(data.data(), data.size());
174 void SaveAs(
const std::string& path,
const Database& db,
const std::string& password,
175 const std::string& keyfile =
"");
189 const std::string& keyfile =
"");
211 static std::unique_ptr<Database>
Create(
const std::string& password =
"",
212 Format format = Format::kKdbx4,
217 std::unique_ptr<Database> Import(std::istream& src,
Format format);
219 static void SaveWithOptions(std::ostream& dst,
const Database& db,
const Key& key,
Format format,
220 bool use_cached_key);
221 Format ResolveOutputFormat(
const std::string& path,
const Database& db)
const;
225 Format format_ = Format::kAuto;
Represents a KeePass (KDB/KDBX) database.
Definition database.hh:74
Kdf
Key derivation functions supported by the importer/exporter.
Definition database.hh:80
Cipher
Cipher algorithms supported for encrypting the database payload.
Definition database.hh:77
High-level entry point for opening and saving KeePass databases.
Definition keepass.hh:50
Format GetFormat() const
Returns the configured output format.
Definition keepass.hh:195
void SaveAs(std::ostream &dst, const Database &db, const std::string &password, const std::string &keyfile="")
Saves a database to a stream using a new password and optional key file.
void SaveAs(const std::string &path, const Database &db, const std::string &password, const std::string &keyfile="")
Saves a database to a file using a new password and optional key file.
KeePass(const Key &key)
Constructs an importer/exporter with the given key.
void Save(const std::string &path, const Database &db)
Saves a database to a file.
void Save(std::ostream &dst, const Database &db)
Saves a database to a stream.
std::unique_ptr< Database > Open(std::istream &src)
Opens a KeePass database from a stream with format auto-detection.
void SetFormat(Format format)
Selects the output format.
Definition keepass.hh:192
void Save(std::ostream &dst, const Database &db, const Key &key)
Saves a database to a stream using a new key.
std::unique_ptr< Database > Open(const uint8_t *data, std::size_t size)
Opens a KeePass database from an in-memory byte range.
void SaveAs(std::ostream &dst, const Database &db, const Key &new_key)
Saves a database to a stream using a new key.
KeePass()
Constructs an importer/exporter with an empty key.
void SaveAs(const std::string &path, const Database &db, const Key &new_key)
Saves a database to a file using a new key.
std::unique_ptr< Database > Open(const std::string &path)
Opens a KeePass (KDB or KDBX) database file.
KeePass(const std::string &password, const std::string &keyfile="")
Constructs an importer/exporter from a password and optional key file.
std::unique_ptr< Database > Open(const std::vector< uint8_t > &data)
Opens a KeePass database from an in-memory byte vector.
Definition keepass.hh:106
static std::unique_ptr< Database > Create(const std::string &password="", Format format=Format::kKdbx4, Database::Cipher cipher=Database::Cipher::kAes, Database::Kdf kdf=Database::Kdf::kArgon2id)
Creates a new empty database with generated cryptographic material.
Manages database encryption keys for KDB and KDBX formats.
Definition key.hh:45
In-memory representation of a KeePass database.
Visibility/export macro for the shared library.
#define LIBKEEPASS_API
Marks a class, function or variable as part of the public ABI.
Definition export.hh:43
Database encryption key management for KDB and KDBX formats.