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" or "RangePreview" encrypted pay‐
23 load, use a mongoc_client_t configured with
24 mongoc_auto_encryption_opts_t. The mongoc_auto_encryption_opts_t may be
25 configured to bypass query analysis with
26 mongoc_auto_encryption_opts_set_bypass_query_analysis(). The
27 mongoc_auto_encryption_opts_t must not be configured to bypass auto‐
28 matic encryption with
29 mongoc_auto_encryption_opts_set_bypass_auto_encryption(). Note that the
30 "RangePreview" payload type is part of the experimental Queryable En‐
31 cryption API and may be subject to breaking changes in future re‐
32 leases.. The Range algorithm is experimental only and not intended for
33 public use. It is subject to breaking changes.
34
35 To insert with a RangePreview payload
36 mongoc_client_encryption_encrypt_range_opts_t must be set in opts.
37
38 To query with a RangePreview payload, use
39 mongoc_client_encryption_encrypt_expression()
40
41 NOTE that the Range algorithm is experimental only and not intended for
42 public use. It is subject to breaking changes.
43
45 • client_encryption: A mongoc_client_encryption_t
46
47 • value: The value to encrypt.
48
49 • opts: A mongoc_client_encryption_encrypt_opts_t.
50
51 • ciphertext: A bson_value_t for the resulting ciphertext (a BSON bi‐
52 nary with subtype 6).
53
54 • error: A bson_error_t set on failure.
55
57 Returns true if successful. Returns false and sets error otherwise.
58
59 SEE ALSO:
60 mongoc_client_encryption_encrypt_opts_t
61
62 mongoc_client_enable_auto_encryption()
63
64 mongoc_client_decryption_decrypt()
65
66 mongoc_client_encryption_encrypt_expression()
67
68
70 MongoDB, Inc
71
73 2017-present, MongoDB, Inc
74
75
76
77
781.24.3 Aug 17, 202M3ONGOC_CLIENT_ENCRYPTION_ENCRYPT(3)