MongoDB\Driver\ClientEncryption::__construct

(mongodb >=1.14.0)

MongoDB\Driver\ClientEncryption::__constructCreate a new ClientEncryption object

Description

finalpublicMongoDB\Driver\ClientEncryption::__construct(array$options)

Constructs a new MongoDB\Driver\ClientEncryption object with the specified options.

Liste de paramètres

options

options
OptionTypeDescription
keyVaultClientMongoDB\Driver\ManagerThe Manager used to route data key queries. This option is required (unlike with MongoDB\Driver\Manager::createClientEncryption()).
keyVaultNamespacechaîne de caractèresUn nom d'espace complètement qualifié (par exemple "databaseName.collectionName") dénotant la collection qui contient toutes les clés de données utilisé pour le chiffrement et déchiffrement. Cette option est requise.
kmsProviderstableau

Un document contenant la configuration d'un ou plusieurs fournisseurs KMS, qui sont utilisés pour chiffrer les clés de données. Les fournisseurs supporté sont "aws", "azure", "gcp" et "local", et au moins un doit être spécifié.

Si un document vide est spécifié pour "aws", "azure", ou "gcp", le pilote tentera de configurer le fournisseur en utilisant » Automatic Credentials.

Le format pour "aws" est le suivant :

aws: { accessKeyId: <string>, secretAccessKey: <string>, sessionToken: <optional string> }

Le format pour "azure" est le suivant :

azure: { tenantId: <string>, clientId: <string>, clientSecret: <string>, identityPlatformEndpoint: <optional string> }

Le format pour "gcp" est le suivant :

gcp: { email: <string>, privateKey: <base64 string>|<MongoDB\BSON\Binary>, endpoint: <optional string> }

Le format pour "kmip" est le suivant :

kmip: { endpoint: <string> }

Le format pour "local" est le suivant :

local: { key: <base64 string>|<MongoDB\BSON\Binary> }
tlsOptionsarray

Un document contenant la configuration TLS d'un ou plusieurs fournisseurs KMS. Les fournisseurs supporté sont "aws", "azure", "gcp" et "kmip". Tous les fournisseurs supportent les options suivantes :

<provider>: { tlsCaFile: <optional string>, tlsCertificateKeyFile: <optional string>, tlsCertificateKeyFilePassword: <optional string>, tlsDisableOCSPEndpointCheck: <optional bool> }

Erreurs / Exceptions

  • Lance une exception MongoDB\Driver\InvalidArgumentException lors d'une erreur survenue pendant l'analyse d'un argument.
  • Throws MongoDB\Driver\Exception\RuntimeException if the extension was compiled without libmongocrypt support

Historique

VersionDescription
PECL mongodb 1.16.0

The AWS KMS provider for client-side encryption now accepts a "sessionToken" option, which can be used to authenticate with temporary AWS credentials.

Added "tlsDisableOCSPEndpointCheck" to the "tlsOptions" option.

If an empty document is specified for the "azure" or "gcp" KMS provider, the driver will attempt to configure the provider using » Automatic Credentials.

PECL mongodb 1.15.0

If an empty document is specified for the "aws" KMS provider, the driver will attempt to configure the provider using » Automatic Credentials.

Voir aussi

To Top