6.4.4.5 Using the component_keyring_encrypted_file Encrypted File-Based Keyring Component使用基于component_keyring_encrypted_file加密文件的密钥环组件

Note注意

component_keyring_encrypted_file is an extension included in MySQL Enterprise Edition, a commercial product. component_keyring_encrypted_file是商业产品MySQL企业版中包含的扩展。To learn more about commercial products, see https://www.mysql.com/products/.要了解有关商业产品的更多信息,请参阅https://www.mysql.com/products/

The component_keyring_encrypted_file keyring component stores keyring data in an encrypted, password-protected file local to the server host.component_keyring_encrypted_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_encrypted_file for keystore management, you must:要使用component_keyring_encrypted_file进行密钥库管理,您必须:

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

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

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

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

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

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

Keyring operations are transactional: component_keyring_encrypted_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_encrypted_file在写入操作期间使用备份文件,以确保在操作失败时可以回滚到原始文件。The backup file has the same name as the data file with a suffix of .backup.备份文件与数据文件同名,后缀为.backup

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

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_encrypted_file, see Section 6.4.4.12, “Supported Keyring Key Types and Lengths”.有关component_keyring_encrypted_file允许的键值特征的信息,请参阅第6.4.4.12节,“支持的密钥环密钥类型和长度”