---
name: "mongoc_auto_encryption_opts_set_key_vault_client"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_auto_encryption_opts_set_key_vault_client"
---

# mongoc\_auto\_encryption\_opts\_set\_key\_vault\_client(3)

## SYNOPSIS

```
void
mongoc_auto_encryption_opts_set_keyvault_client (
   mongoc_auto_encryption_opts_t *opts, mongoc_client_t *client);
```

Set an optional separate *mongoc\_client\_t* to use during key lookup for automatic encryption and decryption. Only applies to automatic encryption on a single-threaded *mongoc\_client\_t*.

## PARAMETERS

- •

  **opts**: A *mongoc\_auto\_encryption\_opts\_t*.

- •

  **client**: A *mongoc\_client\_t* to use for key queries. This client should *not* have automatic encryption enabled, as it will only execute **find** commands against the key vault collection to retrieve keys for automatic encryption and decryption. This **client** MUST outlive any *mongoc\_client\_t* which has been enabled to use it through *mongoc\_client\_enable\_auto\_encryption()*.

**SEE ALSO:**

```
mongoc_client_enable_auto_encryption()
```

```
mongoc_auto_encryption_opts_set_keyvault_client_pool()
```

```
In-Use Encryption
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
