In-Use Encryption Tutorial使用中的加密教程
On this page本页内容
In-Use Encryption allows you to connect to your deployments using Queryable Encryption. This connection method allows you to encrypt a subset of fields in your collections.使用中加密允许您使用可查询加密连接到部署。此连接方法允许您加密集合中的字段子集。
You can also use CSFLE to encrypt a subset of fields in your collection. CSFLE encryption is enabled through the schema editor.您还可以使用CSFLE对集合中的字段子集进行加密。CSFLE加密是通过模式编辑器启用的。
Overview概述
This guide shows you how to connect to your deployment and collections using Queryable Encryption.本指南向您展示如何使用Queryable Encryption连接到部署和集合。
This guide uses the air_airlines.json本指南使用了示例中的air_airlines.json data set in the guided examples. The guide covers the process of importing your data set.
数据集。本指南介绍了导入数据集的过程。
Requirements and Limitations要求和限制
In-Use Encryption is an Enterprise/Atlas only feature.在用加密是仅限企业/Atlas的功能。You need a replica set to use this connection option. Your replica set can be a single node or larger.您需要一个副本集才能使用此连接选项。您的复制副本集可以是单个节点,也可以是更大的节点。You need to connect to your deployment on Compass using In-Use Encryption.您需要使用在用加密连接到Compass上的部署。For more information on how to connect to your deployment, see In-Use Encryption Connection tab.有关如何连接到部署的更多信息,请参阅使用中的加密连接选项卡。
Create Your Encrypted Collection创建加密集合
Once your deployment is connected using In-Use Encryption, create your collection using Queryable Encryption. 使用In-Use Encryption连接部署后,请使用Queryable Encryption创建集合。You can create a new database and collection or you can create a new collection in an existing database.您可以创建新的数据库和集合,也可以在现有数据库中创建新的集合。
Procedure过程
Click the Create a Database button or the Create a Collection button.单击“创建数据库”按钮或“创建集合”按钮。
Enter the name of the database and/or collection.输入数据库和/或集合的名称。
Click the Advanced Collection Options drop down.单击“高级集合选项”下拉菜单。
Check the Queryable Encryption box.选中“可查询加密”框。
Specify your Encrypted Fields.指定“加密字段”。
Change the 将path
field value from encryptedField
to the name of the field you want encrypted.path
字段值从encryptedField
更改为要加密的字段的名称。

Here, the encrypted field is the 这里,加密字段是base
field of the air_airlines
data set.air_airlines
数据集的path
字段。
For more information, see Encrypted Fields.有关详细信息,请参阅加密字段。
Click Create Database or Create Collection.单击“创建数据库”或“创建集合”。
Import Your Data导入您的数据
Enable and Disable In-Use Encryption启用和禁用在用加密
You can enable and disable In-Use Encryption in your deployment.您可以在部署中启用和禁用使用中加密。
When In-Use Encryption is enabled:“使用中加密”启用时:
You can modify encrypted values.您可以修改加密的值。You can insert documents and specified fields will be encrypted.您可以插入文档,指定的字段将被加密。
When In-Use Encryption is disabled:“使用中加密”禁用时:
You cannot modify encrypted values. Compass displays the values of these fields as a series of asterisks.您不能修改加密的值。Compass将这些字段的值显示为一系列星号。Inserted documents can not encrypt fields.插入的文档无法加密字段。
Disable In-Use Encryption禁用使用中的加密
To disable In-Use Encryption:要禁用使用中的加密:
Click on In-Use Encryption on left-hand navigation bar.单击左侧导航栏上的“使用中的加密”。

Click the Enable In-Use Encryption for this connection toggle.单击“为此连接启用使用中的加密”切换。
Disabling In-Use Encryption only affects how Compass accesses your data.禁用使用中的加密只会影响Compass访问数据的方式。