MySQL  8.0.27
Source Code Documentation
keyring_service.cc File Reference
#include <stddef.h>
#include <functional>
#include "my_inttypes.h"
#include "mysql/plugin.h"
#include "mysql/plugin_keyring.h"
#include "sql/current_thd.h"
#include "sql/set_var.h"
#include "sql/sql_plugin.h"
#include "sql/sql_plugin_ref.h"

Classes

class  Callback
 Class that stores callback function reference as well as the result of the callback function call (invoke method). More...
 

Functions

static bool key_plugin_cb_fn (THD *, plugin_ref plugin, void *arg)
 Callback function that is called on the plugin. More...
 
static bool iterate_plugins (std::function< bool(st_mysql_keyring *keyring)> fn, bool check_access=true)
 Iterate over plugins of the MYSQL_KEYRING_PLUGIN type and call the function specified by the argument. More...
 
int my_key_fetch (const char *key_id, char **key_type, const char *user_id, void **key, size_t *key_len)
 Iterates over all active keyring plugins and calls the mysql_key_fetch API for the first one found. More...
 
int my_key_store (const char *key_id, const char *key_type, const char *user_id, const void *key, size_t key_len)
 Iterates over all active keyring plugins calls the mysql_key_store API for the first one found. More...
 
int my_key_remove (const char *key_id, const char *user_id)
 Iterates over all active keyring plugins and calls the mysql_key_remove API for the first one found. More...
 
int my_key_generate (const char *key_id, const char *key_type, const char *user_id, size_t key_len)
 Iterates over all active keyring plugins and calls the mysql_key_generate API for the first one found. More...
 
int my_key_iterator_init (void **key_iterator)
 Iterates over all active keyring plugins and calls the mysql_key_iterator_init API for the first one found. More...
 
int my_key_iterator_deinit (void *key_iterator)
 Iterates over all active keyring plugins and calls the mysql_key_iterator_deinit API for the first one found. More...
 
int my_key_iterator_get_key (void *key_iterator, char *key_id, char *user_id)
 Iterates over all active keyring plugins and calls the mysql_key_iterator_get_key API for the first one found. More...
 

Function Documentation

◆ iterate_plugins()

static bool iterate_plugins ( std::function< bool(st_mysql_keyring *keyring)>  fn,
bool  check_access = true 
)
static

Iterate over plugins of the MYSQL_KEYRING_PLUGIN type and call the function specified by the argument.

Parameters
fnFunction that can call plugin defined function.
check_accessPerform access check.
Returns
Result of the fn call.

◆ key_plugin_cb_fn()

static bool key_plugin_cb_fn ( THD ,
plugin_ref  plugin,
void *  arg 
)
static

Callback function that is called on the plugin.

Parameters
pluginPlugin reference.
argOpaque Callback pointer.
Returns
This function always returns true.

◆ my_key_fetch()

int my_key_fetch ( const char *  key_id,
char **  key_type,
const char *  user_id,
void **  key,
size_t *  key_len 
)

Iterates over all active keyring plugins and calls the mysql_key_fetch API for the first one found.

See also
st_mysql_keyring::mysql_key_fetch, mysql_keyring_service_st

◆ my_key_generate()

int my_key_generate ( const char *  key_id,
const char *  key_type,
const char *  user_id,
size_t  key_len 
)

Iterates over all active keyring plugins and calls the mysql_key_generate API for the first one found.

See also
st_mysql_keyring::mysql_key_generate, mysql_keyring_service_st

◆ my_key_iterator_deinit()

int my_key_iterator_deinit ( void *  key_iterator)

Iterates over all active keyring plugins and calls the mysql_key_iterator_deinit API for the first one found.

See also
st_mysql_keyring::mysql_key_iterator_deinit, mysql_keyring_service_st

◆ my_key_iterator_get_key()

int my_key_iterator_get_key ( void *  key_iterator,
char *  key_id,
char *  user_id 
)

Iterates over all active keyring plugins and calls the mysql_key_iterator_get_key API for the first one found.

See also
st_mysql_keyring::mysql_key_iterator_get_key, mysql_keyring_service_st

◆ my_key_iterator_init()

int my_key_iterator_init ( void **  key_iterator)

Iterates over all active keyring plugins and calls the mysql_key_iterator_init API for the first one found.

See also
st_mysql_keyring::mysql_key_iterator_init, mysql_keyring_service_st

◆ my_key_remove()

int my_key_remove ( const char *  key_id,
const char *  user_id 
)

Iterates over all active keyring plugins and calls the mysql_key_remove API for the first one found.

See also
st_mysql_keyring::mysql_key_remove, mysql_keyring_service_st

◆ my_key_store()

int my_key_store ( const char *  key_id,
const char *  key_type,
const char *  user_id,
const void *  key,
size_t  key_len 
)

Iterates over all active keyring plugins calls the mysql_key_store API for the first one found.

See also
st_mysql_keyring::mysql_key_store, mysql_keyring_service_st