MongoDB\Driver\Manager::createClientEncryption

Create a new ClientEncryption object

&reftitle.description; final public `MongoDB\Driver\ClientEncryption` `MongoDB\Driver\Manager::createClientEncryption` `array` `options`

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

&reftitle.parameters;

`options`

- ## options

  Option | Type | Description
  &mongodb.option.encryption.keyVaultClient; &mongodb.option.encryption.keyVaultNamespace; &mongodb.option.encryption.kmsProviders; &mongodb.option.encryption.tlsOptions;

&reftitle.returnvalues;

Returns a new `MongoDB\Driver\ClientEncryption` instance.

&reftitle.errors;

&mongodb.throws.argumentparsing;
- Throws `MongoDB\Driver\Exception\RuntimeException` if the extension was compiled without libmongocrypt support

&reftitle.changelog;

&Version; | &Description;
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.
PECL mongodb 1.12.0 | KMIP is now supported as a KMS provider for client-side encryption and may be configured in the `"kmsProviders"` option. Added the `"tlsOptions"` option.
PECL mongodb 1.10.0 | Azure and GCP are now supported as KMS providers for client-side encryption and may be configured in the `"kmsProviders"` option. Base64-encoded strings are now accepted as an alternative to `MongoDB\BSON\Binary` for options within `"kmsProviders"`.

&reftitle.seealso;

- `MongoDB\Driver\ClientEncryption::__construct`
- Explicit (Manual) Client-Side Field Level Encryption in the MongoDB manual