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

Dispatches between the supported KDBX key derivation functions. More...

#include <kdbx_kdf.hh>

Static Public Member Functions

static void ParseParameters (std::istream &field, Database &db)
 Parses the KDF parameters header field of a KDBX 4 database.
 
static void WriteParameters (std::ostream &dst, const Database &db)
 Writes the KDF parameters of db into a variant dictionary stream.
 
static SecureBuffer< 32 > Transform (const Key &key, const Database &db, Key::SubKeyResolution resolution)
 Derives the transformed key using the database's configured KDF.
 

Detailed Description

Dispatches between the supported KDBX key derivation functions.

All operations are static: the class carries no per-instance state and only translates between the KDBX 4 variant dictionary representation, the Database KDF settings and the Key transformation functions.

Member Function Documentation

◆ ParseParameters()

static void keepass::KdbxKdf::ParseParameters ( std::istream &  field,
Database &  db 
)
static

Parses the KDF parameters header field of a KDBX 4 database.

Reads the serialized variant dictionary from field, identifies the KDF by its UUID and populates the KDF settings on db.

Parameters
fieldStream containing the serialized KDF parameters.
dbThe database to populate with the parsed KDF settings.

◆ Transform()

static SecureBuffer< 32 > keepass::KdbxKdf::Transform ( const Key &  key,
const Database &  db,
Key::SubKeyResolution  resolution 
)
static

Derives the transformed key using the database's configured KDF.

Parameters
keyThe user key to transform (password / key file / composite).
dbThe database providing the KDF parameters.
resolutionStrategy for resolving sub keys before the transform.
Returns
The derived 32-byte transformed key.

◆ WriteParameters()

static void keepass::KdbxKdf::WriteParameters ( std::ostream &  dst,
const Database &  db 
)
static

Writes the KDF parameters of db into a variant dictionary stream.

Parameters
dstOutput stream to serialize the KDF parameters into.
dbThe database whose KDF settings to serialize.

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