MySQL 9.1.0
Source Code Documentation
mysql_harness::KeyringFile Class Reference

KeyringFile class. More...

#include <keyring_file.h>

Inheritance diagram for mysql_harness::KeyringFile:
[legend]

Public Member Functions

 KeyringFile ()=default
 
void set_header (const std::string &data)
 Sets additional data to be stored with the file but will not be encrypted. More...
 
void save (const std::string &file_name, const std::string &key) const
 Saves keyring to file. More...
 
void load (const std::string &file_name, const std::string &key)
 Load keyring from file. More...
 
std::string read_header (const std::string &file_name)
 Read header data from file. More...
 
- Public Member Functions inherited from mysql_harness::KeyringMemory
 KeyringMemory ()=default
 
std::vector< char > serialize (const std::string &key) const
 Serializes and encrypts keyring data to memory buffer. More...
 
void parse (const std::string &key, const char *buffer, std::size_t buffer_size)
 Parses and decrypts keyring data. More...
 
void store (const std::string &uid, const std::string &attribute, const std::string &value) override
 Stores an attribute value in an entry. More...
 
std::string fetch (const std::string &uid, const std::string &attribute) const override
 Retrieves attribute value from an entry. More...
 
bool remove (const std::string &uid) override
 Removes an entry. More...
 
bool remove_attribute (const std::string &uid, const std::string &attribute) override
 Removes an attribute from an entry. More...
 
const std::map< std::string, std::map< std::string, std::string > > & entries () const
 
- Public Member Functions inherited from mysql_harness::Keyring
 Keyring ()=default
 
 Keyring (const Keyring &)=default
 
Keyringoperator= (const Keyring &)=default
 
virtual ~Keyring ()=default
 

Private Attributes

std::string header_
 

Additional Inherited Members

- Static Public Attributes inherited from mysql_harness::KeyringMemory
constexpr static unsigned int kFormatVersion = 0
 

Detailed Description

KeyringFile class.

Implements Keyring interface and provides additional methods for loading and saving keyring to file.

Constructor & Destructor Documentation

◆ KeyringFile()

mysql_harness::KeyringFile::KeyringFile ( )
default

Member Function Documentation

◆ load()

void mysql_harness::KeyringFile::load ( const std::string &  file_name,
const std::string &  key 
)

Load keyring from file.

Parameters
[in]file_nameKeyring file name.
[in]keyKey used for decryption.
Exceptions
std::exceptionLoading from file failed.

◆ read_header()

std::string mysql_harness::KeyringFile::read_header ( const std::string &  file_name)

Read header data from file.

Parameters
[in]file_nameKeyring file name.
Exceptions
std::exceptionLoading from file failed.

◆ save()

void mysql_harness::KeyringFile::save ( const std::string &  file_name,
const std::string &  key 
) const

Saves keyring to file.

Parameters
[in]file_nameKeyring file name.
[in]keyKey used for encryption.
Exceptions
std::exceptionSaving to file failed.

◆ set_header()

void mysql_harness::KeyringFile::set_header ( const std::string &  data)

Sets additional data to be stored with the file but will not be encrypted.

Parameters
[in]datato store in header

Member Data Documentation

◆ header_

std::string mysql_harness::KeyringFile::header_
private

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