Docs HomeMongoDB Manual

Install libmongocrypt安装libmongocrypt

Queryable Encryption with equality queries is generally available (GA) in MongoDB 7.0 and later. 具有相等查询的可查询加密在MongoDB 7.0及更高版本中通常可用(GA)。The Queryable Encryption Public Preview, released in version 6.0, is no longer supported. Data encrypted using the Public Preview is incompatible with the feature release. 不再支持6.0版本中发布的“可查询加密预览”。使用公共预览加密的数据与功能版本不兼容。For more information, see Compatibility Changes in MongoDB 7.0.有关更多信息,请参阅MongoDB 7.0中的兼容性更改

Overview概述

Learn how to install libmongocrypt, a core component of Queryable Encryption. This library performs encryption and decryption and manages communication between the driver and the Key Management Service.了解如何安装可查询加密的核心组件libmongocrypt。该库执行加密和解密,并管理驱动程序和键管理服务之间的通信。

You do not need to install this library if it is packaged with the driver that you are using. 如果此库与您正在使用的驱动程序打包在一起,则无需安装。To learn which drivers require installation of libmongocrypt, check that it is listed as a dependency in the Driver Compatibility Table.要了解哪些驱动程序需要安装libmongocrypt,请检查驱动程序兼容性表中是否将其列为依赖项。

Warning

Do not build libmongocrypt from source. Use one of the installation methods listed on this page.不要从源代码构建libmongocrypt。请使用本页列出的其中一种安装方法。

macOS Installation安装

brew install mongodb/brew/libmongocrypt

Windows InstallationWindows安装

Click here to begin a download with the latest release binary and includes directory.单击此处开始下载最新版本的二进制文件和includes目录。

Linux Installation安装

Debian

1

Import the public key used to sign the package repositories:导入用于对包存储库进行签名的公钥:

sudo sh -c 'curl -s --location https://www.mongodb.org/static/pgp/libmongocrypt.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/libmongocrypt.gpg'
2

Add the MongoDB repository to your package sources:将MongoDB存储库添加到包源中:

Important

Change <release> in the following shell command to your platform release (e.g. "xenial" or "buster").将以下shell命令中的<release>更改为您的平台版本(例如“xenial”或“buster”)。

echo "deb https://libmongocrypt.s3.amazonaws.com/apt/debian <release>/libmongocrypt/1.8 main" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
3

Update the package cache:更新包缓存:

sudo apt-get update
4

Install libmongocrypt:

sudo apt-get install -y libmongocrypt

Ubuntu

1

Import the public key used to sign the package repositories:导入用于对包存储库进行签名的公钥:

sudo sh -c 'curl -s --location https://www.mongodb.org/static/pgp/libmongocrypt.asc | gpg --dearmor >/etc/apt/trusted.gpg.d/libmongocrypt.gpg'
2

Add the MongoDB repository to your package sources:将MongoDB存储库添加到包源中:

Important

Change <release> in the following shell command to your platform release (e.g. "xenial" or "buster").将以下shell命令中的<release>更改为您的平台版本(例如“xenial”或“buster”)。

echo "deb https://libmongocrypt.s3.amazonaws.com/apt/ubuntu <release>/libmongocrypt/1.8 universe" | sudo tee /etc/apt/sources.list.d/libmongocrypt.list
3

Update the package cache:更新包缓存:

sudo apt-get update
4

Install libmongocrypt:安装libmongocrypt

sudo apt-get install -y libmongocrypt-dev

RedHat

1

Create a repository file for the libmongocrypt package:libmongocrypt包创建存储库文件:

[libmongocrypt]
name=libmongocrypt repository
baseurl=https://libmongocrypt.s3.amazonaws.com/yum/redhat/$releasever/libmongocrypt/1.8/x86_64
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/libmongocrypt.asc
2

Install the libmongocrypt package:安装libmongocrypt包:

sudo yum install -y libmongocrypt

Amazon Linux 2

1

Create a repository file for the libmongocrypt package:libmongocrypt包创建存储库文件:

[libmongocrypt]
name=libmongocrypt repository
baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2/libmongocrypt/1.8/x86_64
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/libmongocrypt.asc
2

Install the libmongocrypt package:安装libmongocrypt包:

sudo yum install -y libmongocrypt

Amazon Linux

1

Create a repository file for the libmongocrypt package:libmongocrypt包创建存储库文件:

[libmongocrypt]
name=libmongocrypt repository
baseurl=https://libmongocrypt.s3.amazonaws.com/yum/amazon/2013.03/libmongocrypt/1.8/x86_64
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/libmongocrypt.asc
2

Install the libmongocrypt package:安装libmongocrypt包:

sudo yum install -y libmongocrypt

Suse

1

Import the public key used to sign the package repositories:导入用于对包存储库进行签名的公钥:

sudo rpm --import https://www.mongodb.org/static/pgp/libmongocrypt.asc
2

Add the repository to your package sources:将存储库添加到包源:

Important

Change <release> in the following shell command to your platform release (e.g. "12" or "15").将以下shell命令中的<release>更改为您的平台版本(例如“12”或“15”)。

sudo zypper addrepo --gpgcheck "https://libmongocrypt.s3.amazonaws.com/zypper/suse/<release>/libmongocrypt/1.8/x86_64" libmongocrypt
3

Install the libmongocrypt package:安装libmongocrypt包:

sudo zypper -n install libmongocrypt