---
name: "mongoc_client_encryption_encrypt_opts_set_keyid"
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_client_encryption_encrypt_opts_set_keyid"
---

# mongoc\_client\_encryption\_encrypt\_opts\_set\_keyid(3)

## SYNOPSIS

```
void
mongoc_client_encryption_encrypt_opts_set_keyid (
   mongoc_client_encryption_encrypt_opts_t *opts, const bson_value_t *keyid);
```

Identifies the data key to use for encryption. This option is mutually exclusive with *mongoc\_client\_encryption\_encrypt\_opts\_set\_keyaltname()*.

## PARAMETERS

- •

  **opts**: A *mongoc\_client\_encryption\_encrypt\_opts\_t*

- •

  **keyid**: The UUID (BSON binary subtype 0x04) corresponding to the **\_id** of the data key.

**SEE ALSO:**

```
mongoc_client_encryption_encrypt_opts_set_keyaltname()
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
