1MONGOC_CLIENT_ENCRYPTION_CREATE_DATAlKiMEbOYmN(oG3nO)gCo_cCLIENT_ENCRYPTION_CREATE_DATAKEY(3)
2
3
4
6 mongoc_client_encryption_create_datakey - mongoc_client_encryption_cre‐
7 ate_datakey()
8
10 bool
11 mongoc_client_encryption_create_datakey (
12 mongoc_client_encryption_t *client_encryption,
13 const char *kms_provider,
14 mongoc_client_encryption_datakey_opts_t *opts,
15 bson_value_t *keyid,
16 bson_error_t *error);
17
18 Creates a new key document in the key vault collection and sets keyid
19 to the UUID of the newly created key if keyid is not NULL. The new key
20 can be used to configure automatic encryption (see mon‐
21 goc_client_enable_auto_encryption() and mon‐
22 goc_client_pool_enable_auto_encryption()) or for explicit encryption
23 (see mongoc_client_encryption_encrypt()).
24
25 The created key document is inserted into the key vault collection
26 (identified via mongoc_client_encryption_opts_set_keyvault_namespace())
27 with majority write concern.
28
29 keyid is always initialized (even on error). Caller must call
30 bson_value_destroy() on keyid to free.
31
33 · client_encryption: A mongoc_client_encryption_t.
34
35 · kms_provider: A string identifying the Key Management Service (KMS)
36 provider used to encrypt the datakey (e.g. "aws" or "local").
37
38 · opts: A mongoc_client_encryption_datakey_opts_t
39
40 · keyid: The resulting UUID key ID of the newly created key.
41
42 · error: A bson_error_t
43
45 Returns true if successful. Returns false and sets error otherwise.
46
48 · mongoc_client_encryption_datakey_opts_t
49
51 MongoDB, Inc
52
54 2017-present, MongoDB, Inc
55
56
57
58
591.17.4 FebM0O4N,GO2C0_2C1LIENT_ENCRYPTION_CREATE_DATAKEY(3)