6.4.4.4 Using the component_keyring_file File-Based Keyring Component使用基于component_keyring_file文件的密钥环组件

The component_keyring_file keyring component stores keyring data in a file local to the server host.component_keyring_file密钥环组件将密钥环数据存储在服务器主机本地的文件中。

Warning警告

For encryption key management, the component_keyring_file and component_keyring_encrypted_file components, and the keyring_file and keyring_encrypted_file plugins are not intended as a regulatory compliance solution. 对于加密密钥管理,component_keyring_filecomponent_keysring_encrypted_file组件以及keyring_fileskeyring_encrypted_file插件不打算作为监管合规解决方案。Security standards such as PCI, FIPS, and others require use of key management systems to secure, manage, and protect encryption keys in key vaults or hardware security modules (HSMs).PCI、FIPS等安全标准要求使用密钥管理系统来保护、管理和保护密钥库或硬件安全模块(HSM)中的加密密钥。

To use component_keyring_file for keystore management, you must:要使用component_keyring_file进行密钥库管理,您必须:

  1. Write a manifest that tells the server to load component_keyring_file, as described in Section 6.4.4.2, “Keyring Component Installation”.编写一个清单,告诉服务器加载component_keyring_file,如第6.4.4.2节,“keyring组件安装”所述。

  2. Write a configuration file for component_keyring_file, as described here.component_keyring_file编写一个配置文件,如下所述。

When it initializes, component_keyring_file reads either a global configuration file, or a global configuration file paired with a local configuration file:初始化时,component_keyring_file读取全局配置文件或与本地配置文件配对的全局配置文件:

Local configuration files permit setting up multiple server instances to use component_keyring_file, such that component configuration for each server instance is specific to a given data directory instance. 本地配置文件允许设置多个服务器实例以使用component_keyring_file,这样每个服务器实例的组件配置都特定于给定的数据目录实例。This enables the same keyring component to be used with a distinct data file for each instance.这使得同一个密钥环组件可以与每个实例的不同数据文件一起使用。

component_keyring_file configuration files have these properties:component_keyring_file配置文件具有以下属性:

Given the preceding configuration file properties, to configure component_keyring_file, create a global configuration file named component_keyring_file.cnf in the directory where the component_keyring_file library file is installed, and optionally create a local configuration file, also named component_keyring_file.cnf, in the data directory. 给定前面的配置文件属性,要配置component_keyring_file,请在安装component_keysring_file库文件的目录中创建一个名为component_kelring_file.cnf的全局配置文件,并在数据目录中可选地创建一个也名为compound_keyring_file.cnf的本地配置文件。The following instructions assume that a keyring data file named /usr/local/mysql/keyring/component_keyring_file is to be used in read/write fashion.以下说明假设以读/写方式使用名为/usr/local/mysql/keyring/component_keyring_file的密钥环数据文件。

Keyring operations are transactional: component_keyring_file uses a backup file during write operations to ensure that it can roll back to the original file if an operation fails. 密钥环操作是事务性的:component_Keyring_file在写入操作期间使用备份文件,以确保在操作失败时可以回滚到原始文件。The backup file has the same name as the data file with a suffix of .backup.备份文件与数据文件同名,后缀为.backup

component_keyring_file supports the functions that comprise the standard MySQL Keyring service interface. Keyring operations performed by those functions are accessible at two levels:component_keyring_file支持构成标准MySQL密钥环服务接口的函数。这些功能执行的钥匙扣操作可在两个级别访问:

Example (using the SQL interface):示例(使用SQL接口):

SELECT keyring_key_generate('MyKey', 'AES', 32);
SELECT keyring_key_remove('MyKey');

For information about the characteristics of key values permitted by component_keyring_file, see Section 6.4.4.12, “Supported Keyring Key Types and Lengths”.有关component_keyring_file允许的键值特征的信息,请参阅第6.4.4.12节,“支持的密钥环密钥类型和长度”