1MONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)libmongocMONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)
2
3
4
6 mongoc_client_encryption_encrypt - mongoc_client_encryption_encrypt()
7
9 bool
10 mongoc_client_encryption_encrypt (
11 mongoc_client_encryption_t *client_encryption,
12 const bson_value_t *value,
13 mongoc_client_encryption_encrypt_opts_t *opts,
14 bson_value_t *ciphertext,
15 bson_error_t *error);
16
17 Performs explicit encryption.
18
19 ciphertext is always initialized (even on failure). Caller must call
20 bson_value_destroy() to free.
21
22 To insert or query with an "Indexed" encrypted payload, use a
23 mongoc_client_t configured with mongoc_auto_encryption_opts_t. The
24 mongoc_auto_encryption_opts_t may be configured to bypass query analy‐
25 sis with mongoc_auto_encryption_opts_set_bypass_query_analysis(). The
26 mongoc_auto_encryption_opts_t must not be configured to bypass auto‐
27 matic encryption with
28 mongoc_auto_encryption_opts_set_bypass_auto_encryption(). Note that the
29 "Indexed" payload type is part of the experimental Queryable Encryption
30 API and may be subject to breaking changes in future releases.
31
33 • client_encryption: A mongoc_client_encryption_t
34
35 • value: The value to encrypt.
36
37 • opts: A mongoc_client_encryption_encrypt_opts_t.
38
39 • ciphertext: A bson_value_t for the resulting ciphertext (a BSON bi‐
40 nary with subtype 6).
41
42 • error: A bson_error_t set on failure.
43
45 Returns true if successful. Returns false and sets error otherwise.
46
47 SEE ALSO:
48 mongoc_client_encryption_encrypt_opts_t
49
50 mongoc_client_enable_auto_encryption()
51
52 mongoc_client_decryption_decrypt()
53
54
56 MongoDB, Inc
57
59 2017-present, MongoDB, Inc
60
61
62
63
641.23.1 Oct 20, 202M2ONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)