libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
kdbx_kdf.hh
Go to the documentation of this file.
1/*
2 * libkeepass - KeePass key database importer/exporter
3 * Copyright (C) 2014 Christian Kindahl
4 * Copyright (C) 2024 Dominik Krümpelmann
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
30#pragma once
31#include <cstdint>
32#include <istream>
33#include <ostream>
34
36#include "libkeepass/export.hh"
37#include "libkeepass/key.hh"
38#include "libkeepass/secure.hh"
39
40namespace keepass {
41
50public:
52
59 static void ParseParameters(std::istream& field, Database& db);
60
62
66 static void WriteParameters(std::ostream& dst, const Database& db);
67
69
75 static SecureBuffer<32> Transform(const Key& key, const Database& db,
76 Key::SubKeyResolution resolution);
77};
78
79} // namespace keepass
Represents a KeePass (KDB/KDBX) database.
Definition database.hh:74
Dispatches between the supported KDBX key derivation functions.
Definition kdbx_kdf.hh:49
static SecureBuffer< 32 > Transform(const Key &key, const Database &db, Key::SubKeyResolution resolution)
Derives the transformed key using the database's configured KDF.
static void WriteParameters(std::ostream &dst, const Database &db)
Writes the KDF parameters of db into a variant dictionary stream.
static void ParseParameters(std::istream &field, Database &db)
Parses the KDF parameters header field of a KDBX 4 database.
Manages database encryption keys for KDB and KDBX formats.
Definition key.hh:45
SubKeyResolution
Definition key.hh:59
Fixed-size byte buffer that is zeroized on destruction.
Definition secure.hh:79
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.
Secure memory handling: zeroization, locked allocations and sensitive value containers.