---
name: "mongoc_client_encryption_rewrap_many_datakey"
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_rewrap_many_datakey"
---

# mongoc\_client\_encryption\_rewrap\_many\_datakey(3)

## SYNOPSIS

```
bool
mongoc_client_encryption_rewrap_many_datakey (
   mongoc_client_encryption_t *client_encryption,
   const bson_t *filter,
   const char *provider,
   const bson_t *master_key,
   mongoc_client_encryption_rewrap_many_datakey_result_t *result,
   bson_error_t *error);
```

Rewraps zero or more data keys in the key vault collection that match the provided **filter**.

A **NULL** argument for **filter** is equivalent to being given an empty document (match all).

If **provider** is **NULL**, rewraps matching data keys with their current KMS provider and master key.

If **provider** is not **NULL**, rewraps matching data keys with the new KMS provider as described by **master\_key**. The **master\_key** document must conform to the *Client Side Encryption specification*.

## PARAMETERS

- •

  **client\_encryption**: A *mongoc\_client\_encryption\_t*.

- •

  **filter**: The filter to use when finding data keys to rewrap in the key vault collection.

- •

  **provider**: The new KMS provider to use to encrypt the data keys, or **NULL** to use the current KMS provider(s).

- •

  **master\_key**: The master key fields corresponding to the new KMS provider when **provider** is not **NULL**.

- •

  **result**: An optional *mongoc\_client\_encryption\_rewrap\_many\_datakey\_result\_t*.

- •

  **error**: A *bson\_error\_t* set on failure.

## RETURNS

Returns **true** if successful. Returns **false** and sets **error** otherwise.

**SEE ALSO:**

```
mongoc_client_encryption_rewrap_many_datakey_result_t
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
