========================================= MongoDB\\Client::createClientEncryption() ========================================= .. default-domain:: mongodb .. contents:: On this page :local: :backlinks: none :depth: 1 :class: singlecol Definition ---------- .. phpmethod:: MongoDB\\Client::createClientEncryption() Returns a :php:`MongoDB\\Driver\\ClientEncryption ` object for manual encryption and decryption of values. .. code-block:: php function createClientEncryption(array $options): MongoDB\Driver\ClientEncryption This method has the following parameters: .. include:: /includes/apiargs/MongoDBClient-method-createClientEncryption-param.rst The ``$options`` parameter supports all options documented in the :php:`extension manual `. For the ``keyVaultClient`` option, an instance of :phpclass:`MongoDB\\Client` is automatically unwrapped and the :php:`MongoDB\\Driver\\Manager ` instance is passed to the extension. Return Values ------------- A :php:`MongoDB\\Driver\\ClientEncryption ` instance which can be used to encrypt and decrypt values. Errors/Exceptions ----------------- .. include:: /includes/extracts/error-invalidargumentexception.rst .. include:: /includes/extracts/error-driver-invalidargumentexception.rst See Also -------- - :php:`MongoDB\\Driver\\Manager::createClientEncryption() `