---
name: "mongoc_client_decryption_decrypt"
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_decryption_decrypt"
---

# mongoc\_client\_decryption\_decrypt(3)

## SYNOPSIS

```
bool
mongoc_client_encryption_decrypt (mongoc_client_encryption_t *client_encryption,
                                  const bson_value_t *ciphertext,
                                  bson_value_t *value,
                                  bson_error_t *error);
```

Performs explicit decryption.

**value** is always initialized (even on failure). Caller must call *bson\_value\_destroy()* to free.

## PARAMETERS

- •

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

- •

  **ciphertext**: The ciphertext (a BSON binary with subtype 6) to decrypt.

- •

  **value**: A *bson\_value\_t* for the resulting decrypted value.

- •

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

## RETURNS

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

**SEE ALSO:**

```
mongoc_client_enable_auto_encryption()
```

```
mongoc_client_encryption_encrypt()
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
