MongoDB\Client::createClientEncryption()

For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

MongoDB\Client::createClientEncryption()

Definition

Returns a MongoDB\Driver\ClientEncryption object for manual encryption and decryption of values.

function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption

Parameters

$options : array

An array specifying the desired options. Refer to the MongoDB\Driver\Manager::createClientEncryption() extension documentation for a list of supported options.

If a [MongoDB\Client](https://www.mongodb.com/docs/php-library/current/reference/class/mongodbclient.md#mongodb-phpclass-phpclass.MongoDB-Client is provided for the keyVaultClient option, it will be unwrapped into a MongoDB\Driver\Manager for the extension.

Return Values

A MongoDB\Driver\ClientEncryption instance which can be used to encrypt and decrypt values.

Errors/Exceptions

[MongoDB\Exception\InvalidArgumentException](https://www.mongodb.com/docs/php-library/current/reference/exception-classes.md#mongodb-phpclass-phpclass.MongoDB-Exception-InvalidArgumentException for errors related to the parsing of parameters or options.

MongoDB\Driver\Exception\InvalidArgumentException for errors related to the parsing of parameters or options at the extension level.

See Also