(mongodb >=1.14.0)
MongoDB\Driver\ClientEncryption::__construct — 创建一个新的 ClientEncryption 对象
使用指定的选项构造一个新的 MongoDB\Driver\ClientEncryption 对象。
options
| 选项 | 类型 | 描述 |
|---|---|---|
| keyVaultClient | MongoDB\Driver\Manager | 用于路由数据密钥查询的管理器。此选项是必需的(与 MongoDB\Driver\Manager::createClientEncryption() 不同)。 |
| keyVaultNamespace | string | 一个完全限定的命名空间(例如 "databaseName.collectionName"),表示包含用于加密和解密的所有数据密钥的集合。此选项是必需的。 |
| kmsProviders | array |
一个文档,包含一个或多个 KMS 提供程序的配置,这些提供程序用于加密数据密钥。支持的提供程序包括 如果为
aws: {
accessKeyId: <string>,
secretAccessKey: <string>,
sessionToken: <optional string>
}
azure: {
tenantId: <string>,
clientId: <string>,
clientSecret: <string>,
identityPlatformEndpoint: <optional string> // Defaults to "login.microsoftonline.com"
}
gcp: {
email: <string>,
privateKey: <base64 string>|<MongoDB\BSON\Binary>,
endpoint: <optional string> // Defaults to "oauth2.googleapis.com"
}
kmip: {
endpoint: <string>
}
local: {
// 96-byte master key used to encrypt/decrypt data keys
key: <base64 string>|<MongoDB\BSON\Binary>
}
|
| tlsOptions | array |
一个文档,包含一个或多个 KMS 提供程序的 TLS 配置。支持的提供程序包括 <provider>: {
tlsCaFile: <optional string>,
tlsCertificateKeyFile: <optional string>,
tlsCertificateKeyFilePassword: <optional string>,
tlsDisableOCSPEndpointCheck: <optional bool>
}
|
| 版本 | 描述 |
|---|---|
| PECL mongodb 1.16.0 |
客户端加密的 AWS KMS 提供程序现在接受 向 如果为 |
| PECL mongodb 1.15.0 |
如果为 |