MySQL 8.0.40
Source Code Documentation
keyring_common::service_implementation Namespace Reference

Classes

class  Component_callbacks
 

Typedefs

using config_vector = std::vector< std::pair< std::string, std::string > >
 

Functions

bool aes_get_encrypted_size_template (size_t input_length, const char *mode, size_t block_size, size_t *out_size)
 Retrieve required out buffer length information. More...
 
template<typename Backend , typename Data_extension = Data>
bool aes_encrypt_template (const char *data_id, const char *auth_id, const char *mode, size_t block_size, const unsigned char *iv, bool padding, const unsigned char *data_buffer, size_t data_buffer_length, unsigned char *out_buffer, size_t out_buffer_length, size_t *out_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Encrypt given piece of plaintext. More...
 
template<typename Backend , typename Data_extension = Data>
bool aes_decrypt_template (const char *data_id, const char *auth_id, const char *mode, size_t block_size, const unsigned char *iv, bool padding, const unsigned char *data_buffer, size_t data_buffer_length, unsigned char *out_buffer, size_t out_buffer_length, size_t *out_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Decrypt given piece ciphertext. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool generate_template (const char *data_id, const char *auth_id, const char *data_type, size_t data_size, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Generate data and store in keyring. More...
 
template<typename Backend , typename Data_extension = Data>
bool init_keys_metadata_iterator_template (std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Forward iterator initialization. More...
 
template<typename Backend , typename Data_extension = Data>
bool deinit_keys_metadata_iterator_template (std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Iterator deinitialization. More...
 
template<typename Backend , typename Data_extension = Data>
bool keys_metadata_iterator_is_valid (std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Check validity of the iterator. More...
 
template<typename Backend , typename Data_extension = Data>
bool keys_metadata_iterator_next (std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Move iterator forward. More...
 
template<typename Backend , typename Data_extension = Data>
bool keys_metadata_get_length_template (std::unique_ptr< Iterator< Data_extension > > &it, size_t *data_id_length, size_t *auth_id_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Fetch length of metadata for current key pointed by iterator. More...
 
template<typename Backend , typename Data_extension = Data>
bool keys_metadata_get_template (std::unique_ptr< Iterator< Data_extension > > &it, char *data_id, size_t data_id_length, char *auth_id, size_t auth_id_length, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Fetch metadata for current key pointed by iterator. More...
 
bool keyring_metadata_query_keyring_initialized_template (Component_callbacks &callbacks)
 Returns status of the keyring component. More...
 
bool keyring_metadata_query_init_template (std::unique_ptr< config_vector > &it, Component_callbacks &callbacks)
 Initialize metadata iterator. More...
 
bool keyring_metadata_query_deinit_template (std::unique_ptr< config_vector > &it)
 Deinitialize metadata iterator. More...
 
bool keyring_metadata_query_is_valid_template (std::unique_ptr< config_vector > &it)
 Check validity of iterator. More...
 
bool keyring_metadata_query_next_template (std::unique_ptr< config_vector > &it)
 Move iterator forward. More...
 
bool keyring_metadata_query_get_length_template (std::unique_ptr< config_vector > &it, size_t *key_buffer_length, size_t *value_buffer_length)
 Get length information about metadata key and value. More...
 
bool keyring_metadata_query_get_template (char *key_buffer, size_t key_buffer_length, char *value_buffer, size_t value_buffer_length, std::unique_ptr< config_vector > &it)
 Get name and value of metadata at current position. More...
 
template<typename Backend , typename Data_extension = data::Data>
int init_reader_template (const char *data_id, const char *auth_id, std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Initialize reader. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool deinit_reader_template (std::unique_ptr< Iterator< Data_extension > > &it, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Deinitialize reader. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool fetch_length_template (std::unique_ptr< Iterator< Data_extension > > &it, size_t *data_size, size_t *data_type_size, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Fetch length of the data. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool fetch_template (std::unique_ptr< Iterator< Data_extension > > &it, unsigned char *data_buffer, size_t data_buffer_length, size_t *data_size, char *data_type_buffer, size_t data_type_buffer_length, size_t *data_type_size, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Fetches data from keyring. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool store_template (const char *data_id, const char *auth_id, const unsigned char *data, size_t data_size, const char *data_type, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Store data in keyring. More...
 
template<typename Backend , typename Data_extension = data::Data>
bool remove_template (const char *data_id, const char *auth_id, Keyring_operations< Backend, Data_extension > &keyring_operations, Component_callbacks &callbacks)
 Remove data from keyring. More...
 

Typedef Documentation

◆ config_vector

using keyring_common::service_implementation::config_vector = typedef std::vector<std::pair<std::string, std::string> >

Function Documentation

◆ aes_decrypt_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::aes_decrypt_template ( const char *  data_id,
const char *  auth_id,
const char *  mode,
size_t  block_size,
const unsigned char *  iv,
bool  padding,
const unsigned char *  data_buffer,
size_t  data_buffer_length,
unsigned char *  out_buffer,
size_t  out_buffer_length,
size_t *  out_length,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Decrypt given piece ciphertext.

Parameters
[in]data_idName of the key
[in]auth_idOwner of the key
[in]modeAES mode
[in]block_sizeAES block size information
[in]ivInitialization vector
[in]paddingpadding preference
[in]data_bufferInput buffer
[in]data_buffer_lengthInput buffer length
[out]out_bufferOutput buffer
[in]out_buffer_lengthOutput buffer length
[out]out_lengthLength of decrypted data
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure

◆ aes_encrypt_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::aes_encrypt_template ( const char *  data_id,
const char *  auth_id,
const char *  mode,
size_t  block_size,
const unsigned char *  iv,
bool  padding,
const unsigned char *  data_buffer,
size_t  data_buffer_length,
unsigned char *  out_buffer,
size_t  out_buffer_length,
size_t *  out_length,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Encrypt given piece of plaintext.

Parameters
[in]data_idName of the key
[in]auth_idOwner of the key
[in]modeAES mode
[in]block_sizeAES block size information
[in]ivInitialization vector
[in]paddingpadding preference
[in]data_bufferInput buffer
[in]data_buffer_lengthInput buffer length
[out]out_bufferOutput buffer
[in]out_buffer_lengthOutput buffer length
[out]out_lengthLength of encrypted data
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure

◆ aes_get_encrypted_size_template()

bool keyring_common::service_implementation::aes_get_encrypted_size_template ( size_t  input_length,
const char *  mode,
size_t  block_size,
size_t *  out_size 
)

Retrieve required out buffer length information.

Parameters
[in]input_lengthLength of input text
[in]modeBlock encryption mode
[in]block_sizeAES block size
[out]out_sizeOut buffer length
Returns
Output buffer length or error
Return values
falseSuccess
trueError processing given mode and/or block size

◆ deinit_keys_metadata_iterator_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::deinit_keys_metadata_iterator_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Iterator deinitialization.

Parameters
[out]itmetadata iterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
Status of the operation
Return values
falseSuccess
trueFailure

◆ deinit_reader_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::deinit_reader_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Deinitialize reader.

Parameters
[in,out]itIterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure

◆ fetch_length_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::fetch_length_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
size_t *  data_size,
size_t *  data_type_size,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Fetch length of the data.

Parameters
[in]itIterator
[out]data_sizeSize of fetched data
[out]data_type_sizeSize of data type
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure

◆ fetch_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::fetch_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
unsigned char *  data_buffer,
size_t  data_buffer_length,
size_t *  data_size,
char *  data_type_buffer,
size_t  data_type_buffer_length,
size_t *  data_type_size,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Fetches data from keyring.

Parameters
[in]itIterator
[out]data_bufferOut buffer for data
[in]data_buffer_lengthLength of out buffer
[out]data_sizeSize of fetched data
[out]data_type_bufferType of data
[in]data_type_buffer_lengthLength of data type buffer
[out]data_type_sizeSize of data type
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure

◆ generate_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::generate_template ( const char *  data_id,
const char *  auth_id,
const char *  data_type,
size_t  data_size,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Generate data and store in keyring.

Parameters
[in]data_idData Identifier
[in]auth_idAuthorization ID
[in]data_typeType of data. Assumed null terminated.
[in]data_sizeSize of the data to be generated
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess - Key generated and stored in keyring.
trueFailure

◆ init_keys_metadata_iterator_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::init_keys_metadata_iterator_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Forward iterator initialization.

Parameters
[out]itmetadata iterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
Status of the operation
Return values
falseSuccess
trueFailure

◆ init_reader_template()

template<typename Backend , typename Data_extension = data::Data>
int keyring_common::service_implementation::init_reader_template ( const char *  data_id,
const char *  auth_id,
std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Initialize reader.

Parameters
[in]data_idData Identifier
[in]auth_idAuthorization ID
[out]itIterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
-1Keyring error. reader_object will not be created.
0Key not found OR error fetching keys. reader_object will not be created.
1Key found, check out parameters

◆ keyring_metadata_query_deinit_template()

bool keyring_common::service_implementation::keyring_metadata_query_deinit_template ( std::unique_ptr< config_vector > &  it)

Deinitialize metadata iterator.

Parameters
[in,out]itMetadata iterator handle
Returns
Status of iterator deinitialization
Return values
falseSuccess
trueFailure. Check error state.

◆ keyring_metadata_query_get_length_template()

bool keyring_common::service_implementation::keyring_metadata_query_get_length_template ( std::unique_ptr< config_vector > &  it,
size_t *  key_buffer_length,
size_t *  value_buffer_length 
)

Get length information about metadata key and value.

Parameters
[in]itMetadata iterator handle
[out]key_buffer_lengthLength of the key buffer
[out]value_buffer_lengthLength of the value buffer
Returns
Get length information about key and value
Return values
falseSuccess check out parameters
trueError

◆ keyring_metadata_query_get_template()

bool keyring_common::service_implementation::keyring_metadata_query_get_template ( char *  key_buffer,
size_t  key_buffer_length,
char *  value_buffer,
size_t  value_buffer_length,
std::unique_ptr< config_vector > &  it 
)

Get name and value of metadata at current position.

Parameters
[out]key_bufferOutput buffer for key
[in]key_buffer_lengthLength of key buffer
[out]value_bufferOutput buffer for value
[in]value_buffer_lengthLength of value buffer
[in]itMetadata iterator handle
Returns
Status of fetch operation
Return values
falseSuccess
trueFailure. Check error state.

◆ keyring_metadata_query_init_template()

bool keyring_common::service_implementation::keyring_metadata_query_init_template ( std::unique_ptr< config_vector > &  it,
Component_callbacks callbacks 
)

Initialize metadata iterator.

Parameters
[out]itMetadata iterator handle
[in]callbacksComponent callback handle
Returns
Status of iterator initialization
Return values
falseSuccess
trueFailure. Check error state.

◆ keyring_metadata_query_is_valid_template()

bool keyring_common::service_implementation::keyring_metadata_query_is_valid_template ( std::unique_ptr< config_vector > &  it)

Check validity of iterator.

Parameters
[in]itMetadata iterator handle
Returns
Validity of the the iterator
Return values
trueIterator valid
falseIterator invalid

◆ keyring_metadata_query_keyring_initialized_template()

bool keyring_common::service_implementation::keyring_metadata_query_keyring_initialized_template ( Component_callbacks callbacks)

Returns status of the keyring component.

Parameters
[in]callbacksComponent specific callbacks
Returns
Status of keyring
Return values
trueInitialized
falseNot initialized

◆ keyring_metadata_query_next_template()

bool keyring_common::service_implementation::keyring_metadata_query_next_template ( std::unique_ptr< config_vector > &  it)

Move iterator forward.

Parameters
[in,out]itMetadata iterator handle
Returns
Status of operation
Return values
falseSuccess
trueFailure.

◆ keys_metadata_get_length_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::keys_metadata_get_length_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
size_t *  data_id_length,
size_t *  auth_id_length,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Fetch length of metadata for current key pointed by iterator.

Parameters
[out]itmetadata iterator
[out]data_id_lengthLength of data_id buffer
[out]auth_id_lengthLength of auth_id buffer
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
Status of the operation
Return values
falseSuccess
trueFailure

◆ keys_metadata_get_template()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::keys_metadata_get_template ( std::unique_ptr< Iterator< Data_extension > > &  it,
char *  data_id,
size_t  data_id_length,
char *  auth_id,
size_t  auth_id_length,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Fetch metadata for current key pointed by iterator.

Parameters
[out]itmetadata iterator
[out]data_idID information of current data
[in]data_id_lengthLength of data_id buffer
[out]auth_idOwner of the key
[in]auth_id_lengthLength of auth_id buffer
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
Status of the operation
Return values
falseSuccess
trueFailure

◆ keys_metadata_iterator_is_valid()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::keys_metadata_iterator_is_valid ( std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Check validity of the iterator.

Parameters
[in]itmetadata iterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
Validty of the iterator
Return values
trueIterator is valid
falseIterator is invalid

◆ keys_metadata_iterator_next()

template<typename Backend , typename Data_extension = Data>
bool keyring_common::service_implementation::keys_metadata_iterator_next ( std::unique_ptr< Iterator< Data_extension > > &  it,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Move iterator forward.

Parameters
[out]itmetadata iterator
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksComponent specific callbacks
Returns
Status of the operation
Return values
falseSuccess - indicates that iterator is pointing to next entry
trueFailure - indicates that iterator has reached the end

◆ remove_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::remove_template ( const char *  data_id,
const char *  auth_id,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Remove data from keyring.

Parameters
[in]data_idData Identifier
[in]auth_idAuthorization ID
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess - Key removed successfully or key not present.
trueFailure

◆ store_template()

template<typename Backend , typename Data_extension = data::Data>
bool keyring_common::service_implementation::store_template ( const char *  data_id,
const char *  auth_id,
const unsigned char *  data,
size_t  data_size,
const char *  data_type,
Keyring_operations< Backend, Data_extension > &  keyring_operations,
Component_callbacks callbacks 
)

Store data in keyring.

Parameters
[in]data_idData Identifier
[in]auth_idAuthorization ID
[in]dataData to be stored
[in]data_sizeSize of data to be stored
[in]data_typeType of data
[in]keyring_operationsReference to the object that handles cache and backend
[in]callbacksHandle to component specific callbacks
Returns
status of the operation
Return values
falseSuccess
trueFailure