---
name: "mongoc_auto_encryption_opts_set_key_expiration"
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_expiration"
---

# mongoc\_auto\_encryption\_opts\_set\_key\_expiration(3)

## SYNOPSIS

```
void
mongoc_auto_encryption_opts_set_key_expiration (
   mongoc_auto_encryption_opts_t *opts, uint64_t cache_expiration_ms);
```

## PARAMETERS

- •

  **opts**: The *mongoc\_auto\_encryption\_opts\_t*

- •

  **cache\_expiration\_ms**: The data encryption key cache expiration time in milliseconds. Defaults to 60,000. 0 means "never expire".

**SEE ALSO:**

```
mongoc_client_enable_auto_encryption()
```

```
In-Use Encryption
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
