1MONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)libmongocMONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)
2
3
4
6 bool
7 mongoc_client_encryption_encrypt (
8 mongoc_client_encryption_t *client_encryption,
9 const bson_value_t *value,
10 mongoc_client_encryption_encrypt_opts_t *opts,
11 bson_value_t *ciphertext,
12 bson_error_t *error);
13
14 Performs explicit encryption.
15
16 ciphertext is always initialized (even on failure). Caller must call
17 bson_value_destroy() to free.
18
19 To insert or query with an "Indexed" or "RangePreview" encrypted pay‐
20 load, use a mongoc_client_t configured with
21 mongoc_auto_encryption_opts_t. The mongoc_auto_encryption_opts_t may be
22 configured to bypass query analysis with
23 mongoc_auto_encryption_opts_set_bypass_query_analysis(). The
24 mongoc_auto_encryption_opts_t must not be configured to bypass auto‐
25 matic encryption with
26 mongoc_auto_encryption_opts_set_bypass_auto_encryption(). Note that the
27 "RangePreview" payload type is part of the experimental Queryable En‐
28 cryption API and may be subject to breaking changes in future re‐
29 leases.. The Range algorithm is experimental only and not intended for
30 public use. It is subject to breaking changes.
31
32 To insert with a RangePreview payload
33 mongoc_client_encryption_encrypt_range_opts_t must be set in opts.
34
35 To query with a RangePreview payload, use
36 mongoc_client_encryption_encrypt_expression()
37
38 NOTE that the Range algorithm is experimental only and not intended for
39 public use. It is subject to breaking changes.
40
42 • client_encryption: A mongoc_client_encryption_t
43
44 • value: The value to encrypt.
45
46 • opts: A mongoc_client_encryption_encrypt_opts_t.
47
48 • ciphertext: A bson_value_t for the resulting ciphertext (a BSON bi‐
49 nary with subtype 6).
50
51 • error: A bson_error_t set on failure.
52
54 Returns true if successful. Returns false and sets error otherwise.
55
56 SEE ALSO:
57 mongoc_client_encryption_encrypt_opts_t
58
59 mongoc_client_enable_auto_encryption()
60
61 mongoc_client_decryption_decrypt()
62
63 mongoc_client_encryption_encrypt_expression()
64
65
67 MongoDB, Inc
68
70 2017-present, MongoDB, Inc
71
72
73
74
751.25.1 Nov 08, 202M3ONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)