MySQL 8.0.40
Source Code Documentation
component_keyring_file

This is keyring component services' implementation with file as backend to store data.

This component implements following keyring services:

  • keyring_aes
  • keyring_generate
  • keyring_keys_metadata_iterator
  • keyring_component_status
  • keyring_metadata_query
  • keyring_reader
  • keyring_reload
  • keyring_writer

Data is stored in JSON format.

{
"version": "1.0",
"elements": [
{
"user": "<user_name>",
"data_id": "<name>",
"data_type": "<data_type>",
"data": "<hex_of_data>",
"extension": []
},
...
...
]
}

For most parts, component_keyring_file relies on keyring_common library for implementation.

The component relies on component_keyring_file.cnf file for configuration.

Location of this configuration file is same directory where component_keyring_file shared library is located. This configuration file should contain information in one of the following formats.

  1. Signal component to read configuration from current working directory
    {
    "read_local_config": true
    }
  2. Details of data file and nature of keyring
    {
    "path": <path to data file>,
    "read_only": <boolean value to signal state of the keyring>
    }
    static char * path
    Definition: mysqldump.cc:137
    Definition: os0file.h:86
    static int signal(mysql_cond_t *that, const char *, unsigned int)
    Definition: mysql_cond_v1_native.cc:87

If configuration file co-located with shared library signals to read configuration locally, current working directory is searched for component_keyring_file.cnf and expected format is 2.

The component exposes following status information through keyring_metadata_query service implementation.

  1. Name of the keyring
  2. Author
  3. Implementation name
  4. Version
  5. Component status
  6. Data file location
  7. Read only status

Note: Implementation does not provide concurrency control. That is responsibility of users of the services.