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 mongoc_client_en‐
21 able_auto_encryption() and mongoc_client_pool_enable_auto_encryption())
22 or for explicit encryption (see mongoc_client_encryption_encrypt()).
23
24 The created key document is inserted into the key vault collection
25 (identified via mongoc_client_encryption_opts_set_keyvault_namespace())
26 with majority write concern.
27
28 keyid is always initialized (even on error). Caller must call
29 bson_value_destroy() on keyid to free.
30
32 • client_encryption: A mongoc_client_encryption_t.
33
34 • kms_provider: A string identifying the Key Management Service (KMS)
35 provider used to encrypt the datakey (e.g. "aws" or "local").
36
37 • opts: A mongoc_client_encryption_datakey_opts_t
38
39 • keyid: The resulting UUID key ID of the newly created key.
40
41 • error: A bson_error_t
42
44 Returns true if successful. Returns false and sets error otherwise.
45
47 • mongoc_client_encryption_datakey_opts_t
48
50 MongoDB, Inc
51
53 2017-present, MongoDB, Inc
54
55
56
57
581.17.6 JunM0O3N,GO2C0_2C1LIENT_ENCRYPTION_CREATE_DATAKEY(3)