23#include <opendht/crypto.h>
38 dht::crypto::Identity
id;
41 std::shared_ptr<dht::crypto::PrivateKey>
ca_key;
44 std::shared_ptr<dht::crypto::RevocationList>
revoked;
57 std::map<std::string, std::string>
config;
72 std::string_view scheme = {},
73 const std::string&
pwd = {})
82 void deserialize(std::string_view data,
const std::vector<uint8_t>& salt);
85 void load(
const std::filesystem::path& path, std::string_view scheme,
const std::string&
pwd)
92 bool save(
const std::filesystem::path& path,
93 std::string_view scheme,
94 const std::string& password)
const
ArchiveStorageData readArchive(const std::filesystem::path &path, std::string_view scheme, const std::string &pwd)
bool writeArchive(const std::string &archive_str, const std::filesystem::path &path, std::string_view scheme, const std::string &password, const std::vector< uint8_t > &password_salt)
void emitSignal(Args... args)
Crypto material contained in the archive, not persisted in the account configuration.
AccountArchive(const std::filesystem::path &path, std::string_view scheme={}, const std::string &pwd={})
void load(const std::filesystem::path &path, std::string_view scheme, const std::string &pwd)
Load archive from file, optionally encrypted with provided password.
bool save(const std::filesystem::path &path, std::string_view scheme, const std::string &password) const
Save archive to file, optionally encrypted with provided password.
std::map< dht::InfoHash, Contact > contacts
Contacts.
void deserialize(std::string_view data, const std::vector< uint8_t > &salt)
Deserialize archive from memory.
AccountArchive(const std::vector< uint8_t > &data, const std::vector< uint8_t > &password_salt={})
std::map< std::string, ConversationRequest > conversationsRequests
std::shared_ptr< dht::crypto::RevocationList > revoked
Revoked devices.
std::string serialize() const
Serialize structured archive data to memory.
std::shared_ptr< dht::crypto::PrivateKey > ca_key
Generated CA key (for self-signed certificates)
AccountArchive(std::string_view data, const std::vector< uint8_t > &password_salt={})
std::vector< uint8_t > password_salt
Salt for the archive encryption password.
dht::crypto::Identity id
Account main private key and certificate chain.
std::map< std::string, ConvInfo > conversations
std::vector< uint8_t > eth_key
Ethereum private key.
std::map< std::string, std::string > config
Account configuration.