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

Process-wide registry for 16-byte block ciphers. More...

#include <cipher_registry.hh>

Public Types

using Factory = std::function< std::unique_ptr< Cipher< 16 > >(const uint8_t *key, const std::array< uint8_t, 16 > &init_vector)>
 Creates a block cipher for the given 32-byte key and IV.
 

Public Member Functions

void Register (Database::Cipher cipher, Factory factory)
 Registers/overwrites the factory for a payload cipher id.
 
std::unique_ptr< Cipher< 16 > > Create (Database::Cipher cipher, const uint8_t *key, const std::array< uint8_t, 16 > &init_vector) const
 Creates a block cipher, or throws UnsupportedFeatureError.
 
bool Contains (Database::Cipher cipher) const
 Returns whether a block-cipher factory is registered for cipher.
 

Static Public Member Functions

static CipherRegistry & Instance ()
 Returns the process-wide registry.
 

Detailed Description

Process-wide registry for 16-byte block ciphers.

The built-in AES and Twofish factories are registered by the registry constructor. External implementations can be added with Register() and are then usable anywhere the core creates a block cipher (KDB/KDBX import and export). ChaCha20 is a stream cipher with its own code path; it is not a block-cipher registration.


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