MySQL 8.4.0
Source Code Documentation
mysql_harness::MasterKeyFile Class Reference

#include <master_key_file.h>

Public Member Functions

 MasterKeyFile (const std::string &file)
 
void load ()
 load master-key-file from disk. More...
 
void save ()
 save master-key-file to disk. More...
 
void add (const std::string &id, const std::string &value, const std::string &key)
 add value-key pair to 'id'. More...
 
void add_encrypted (const std::string &id, const std::string &buf)
 add encrypted buffer to 'id'. More...
 
std::string get (const std::string &id, const std::string &key) const
 get value for 'key' for 'id'. More...
 
std::string get_encrypted (const std::string &id) const
 get value encrypted 'key-value' pair for 'id'. More...
 
bool remove (const std::string &id)
 remove id from master-key-dict. More...
 
const auto & entries () const
 get entries. More...
 

Private Attributes

std::string path_
 
std::vector< std::pair< std::string, std::string > > entries_
 

Constructor & Destructor Documentation

◆ MasterKeyFile()

mysql_harness::MasterKeyFile::MasterKeyFile ( const std::string &  file)
inline

Member Function Documentation

◆ add()

void mysql_harness::MasterKeyFile::add ( const std::string &  id,
const std::string &  value,
const std::string &  key 
)

add value-key pair to 'id'.

encrypts the value-key pair.

Exceptions
std::runtime_erroron failure

◆ add_encrypted()

void mysql_harness::MasterKeyFile::add_encrypted ( const std::string &  id,
const std::string &  buf 
)

add encrypted buffer to 'id'.

Exceptions
std::runtime_erroron failure

◆ entries()

const auto & mysql_harness::MasterKeyFile::entries ( ) const
inline

get entries.

◆ get()

std::string mysql_harness::MasterKeyFile::get ( const std::string &  id,
const std::string &  key 
) const

get value for 'key' for 'id'.

Returns
value for 'key' of 'id'.
Return values
emptyif key or id aren't found

◆ get_encrypted()

std::string mysql_harness::MasterKeyFile::get_encrypted ( const std::string &  id) const

get value encrypted 'key-value' pair for 'id'.

Returns
encrypted buffer of 'id'.
Return values
emptyif key or id aren't found

◆ load()

void mysql_harness::MasterKeyFile::load ( )

load master-key-file from disk.

Exceptions
std::runtime_erroron failure

◆ remove()

bool mysql_harness::MasterKeyFile::remove ( const std::string &  id)

remove id from master-key-dict.

Returns
success
Return values
trueid removed
falseid not removed (not found, ...)

◆ save()

void mysql_harness::MasterKeyFile::save ( )

save master-key-file to disk.

Exceptions
std::runtime_erroron failure

Member Data Documentation

◆ entries_

std::vector<std::pair<std::string, std::string> > mysql_harness::MasterKeyFile::entries_
private

◆ path_

std::string mysql_harness::MasterKeyFile::path_
private

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