libmongocrypt
mongocrypt.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019-present MongoDB, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #ifndef MONGOCRYPT_H
17 #define MONGOCRYPT_H
18 
26 #include "mongocrypt-compat.h"
27 #include "mongocrypt-export.h"
28 
29 /* clang-format off */
30 #ifndef __has_include
31  #include "mongocrypt-config.h"
32 #else
33  #if __has_include("mongocrypt-config.h")
34  #include "mongocrypt-config.h"
35  #else
36  #error No "mongocrypt-config.h" header is available. That file must \
37  be generated in order to use libmongocrypt.
38  #endif
39 #endif
40 /* clang-format on */
41 
48 MONGOCRYPT_EXPORT
49 const char *mongocrypt_version(uint32_t *len);
50 
59 MONGOCRYPT_EXPORT
61 
87 typedef struct _mongocrypt_binary_t {
88  void *data;
89  uint32_t len;
91 
99 MONGOCRYPT_EXPORT
101 
111 MONGOCRYPT_EXPORT
112 mongocrypt_binary_t *mongocrypt_binary_new_from_data(uint8_t *data, uint32_t len);
113 
121 MONGOCRYPT_EXPORT
122 uint8_t *mongocrypt_binary_data(const mongocrypt_binary_t *binary);
123 
131 MONGOCRYPT_EXPORT
132 uint32_t mongocrypt_binary_len(const mongocrypt_binary_t *binary);
133 
141 MONGOCRYPT_EXPORT
143 
152 typedef struct _mongocrypt_status_t mongocrypt_status_t;
153 
157 typedef enum {
158  MONGOCRYPT_STATUS_OK = 0,
159  MONGOCRYPT_STATUS_ERROR_CLIENT = 1,
160  MONGOCRYPT_STATUS_ERROR_KMS = 2,
161  MONGOCRYPT_STATUS_ERROR_CRYPT_SHARED = 3,
163 
173 MONGOCRYPT_EXPORT
175 
192 MONGOCRYPT_EXPORT
195  uint32_t code,
196  const char *message,
197  int32_t message_len);
198 
206 MONGOCRYPT_EXPORT
208 
216 MONGOCRYPT_EXPORT
218 
228 MONGOCRYPT_EXPORT
229 const char *mongocrypt_status_message(mongocrypt_status_t *status, uint32_t *len);
230 
239 MONGOCRYPT_EXPORT
241 
247 MONGOCRYPT_EXPORT
249 
253 typedef enum {
254  MONGOCRYPT_LOG_LEVEL_FATAL = 0,
255  MONGOCRYPT_LOG_LEVEL_ERROR = 1,
256  MONGOCRYPT_LOG_LEVEL_WARNING = 2,
257  MONGOCRYPT_LOG_LEVEL_INFO = 3,
258  MONGOCRYPT_LOG_LEVEL_TRACE = 4
260 
270 typedef void (*mongocrypt_log_fn_t)(mongocrypt_log_level_t level, const char *message, uint32_t message_len, void *ctx);
271 
284 typedef struct _mongocrypt_t mongocrypt_t;
285 
295 MONGOCRYPT_EXPORT
297 
310 MONGOCRYPT_EXPORT
311 bool mongocrypt_setopt_log_handler(mongocrypt_t *crypt, mongocrypt_log_fn_t log_fn, void *log_ctx);
312 
334 MONGOCRYPT_EXPORT
336  const char *aws_access_key_id,
337  int32_t aws_access_key_id_len,
338  const char *aws_secret_access_key,
339  int32_t aws_secret_access_key_len);
340 
355 MONGOCRYPT_EXPORT
357 
369 MONGOCRYPT_EXPORT
371 
384 MONGOCRYPT_EXPORT
386 
399 MONGOCRYPT_EXPORT
401 
430 MONGOCRYPT_EXPORT
432 
456 MONGOCRYPT_EXPORT
458 
473 MONGOCRYPT_EXPORT
475 
485 MONGOCRYPT_EXPORT
487 
501 MONGOCRYPT_EXPORT
502 bool mongocrypt_init(mongocrypt_t *crypt);
503 
513 MONGOCRYPT_EXPORT
515 
521 MONGOCRYPT_EXPORT
522 void mongocrypt_destroy(mongocrypt_t *crypt);
523 
542 MONGOCRYPT_EXPORT
543 const char *mongocrypt_crypt_shared_lib_version_string(const mongocrypt_t *crypt, uint32_t *len);
544 
564 MONGOCRYPT_EXPORT
566 
570 typedef struct _mongocrypt_ctx_t mongocrypt_ctx_t;
571 
581 MONGOCRYPT_EXPORT
583 
595 MONGOCRYPT_EXPORT
597 
612 MONGOCRYPT_EXPORT
614 
637 MONGOCRYPT_EXPORT
639 
655 MONGOCRYPT_EXPORT
657 
678 MONGOCRYPT_EXPORT
679 bool mongocrypt_ctx_setopt_algorithm(mongocrypt_ctx_t *ctx, const char *algorithm, int len);
680 
682 #define MONGOCRYPT_ALGORITHM_DETERMINISTIC_STR "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
683 #define MONGOCRYPT_ALGORITHM_RANDOM_STR "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
685 #define MONGOCRYPT_ALGORITHM_INDEXED_STR "Indexed"
687 #define MONGOCRYPT_ALGORITHM_UNINDEXED_STR "Unindexed"
689 #define MONGOCRYPT_ALGORITHM_RANGEPREVIEW_DEPRECATED_STR "RangePreview"
693 #define MONGOCRYPT_ALGORITHM_RANGE_STR "Range"
694 
713 MONGOCRYPT_EXPORT
715  const char *region,
716  int32_t region_len,
717  const char *cmk,
718  int32_t cmk_len);
719 
737 MONGOCRYPT_EXPORT
738 bool mongocrypt_ctx_setopt_masterkey_aws_endpoint(mongocrypt_ctx_t *ctx, const char *endpoint, int32_t endpoint_len);
739 
750 MONGOCRYPT_EXPORT
752 
804 MONGOCRYPT_EXPORT
806 
821 MONGOCRYPT_EXPORT
823 
838 MONGOCRYPT_EXPORT
839 bool mongocrypt_ctx_encrypt_init(mongocrypt_ctx_t *ctx, const char *db, int32_t db_len, mongocrypt_binary_t *cmd);
840 
876 MONGOCRYPT_EXPORT
878 
924 MONGOCRYPT_EXPORT
926 
940 MONGOCRYPT_EXPORT
942 
956 MONGOCRYPT_EXPORT
958 
971 MONGOCRYPT_EXPORT
973 
980 typedef enum {
981  MONGOCRYPT_CTX_ERROR = 0,
982  MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1, /* run on main MongoClient */
983  MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB = 8, /* run on main MongoClient */
984  MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2, /* run on mongocryptd. */
985  MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3, /* run on key vault */
986  MONGOCRYPT_CTX_NEED_KMS = 4,
987  MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7, /* fetch/renew KMS credentials */
988  MONGOCRYPT_CTX_READY = 5, /* ready for encryption/decryption */
989  MONGOCRYPT_CTX_DONE = 6,
991 
998 MONGOCRYPT_EXPORT
1000 
1021 MONGOCRYPT_EXPORT
1023 
1037 MONGOCRYPT_EXPORT
1038 const char *mongocrypt_ctx_mongo_db(mongocrypt_ctx_t *ctx);
1039 
1062 MONGOCRYPT_EXPORT
1064 
1072 MONGOCRYPT_EXPORT
1074 
1078 typedef struct _mongocrypt_kms_ctx_t mongocrypt_kms_ctx_t;
1079 
1093 MONGOCRYPT_EXPORT
1095 
1109 MONGOCRYPT_EXPORT
1111 
1126 MONGOCRYPT_EXPORT
1127 bool mongocrypt_kms_ctx_endpoint(mongocrypt_kms_ctx_t *kms, const char **endpoint);
1128 
1135 MONGOCRYPT_EXPORT
1137 
1150 MONGOCRYPT_EXPORT
1152 
1161 MONGOCRYPT_EXPORT
1163 
1179 MONGOCRYPT_EXPORT
1180 const char *mongocrypt_kms_ctx_get_kms_provider(mongocrypt_kms_ctx_t *kms, uint32_t *len);
1181 
1190 MONGOCRYPT_EXPORT
1192 
1207 MONGOCRYPT_EXPORT
1208 bool mongocrypt_ctx_provide_kms_providers(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *kms_providers_definition);
1209 
1246 MONGOCRYPT_EXPORT
1248 
1254 MONGOCRYPT_EXPORT
1256 
1274 typedef bool (*mongocrypt_crypto_fn)(void *ctx,
1275  mongocrypt_binary_t *key,
1276  mongocrypt_binary_t *iv,
1277  mongocrypt_binary_t *in,
1278  mongocrypt_binary_t *out,
1279  uint32_t *bytes_written,
1280  mongocrypt_status_t *status);
1281 
1299 typedef bool (*mongocrypt_hmac_fn)(void *ctx,
1300  mongocrypt_binary_t *key,
1301  mongocrypt_binary_t *in,
1302  mongocrypt_binary_t *out,
1303  mongocrypt_status_t *status);
1304 
1318 typedef bool (*mongocrypt_hash_fn)(void *ctx,
1319  mongocrypt_binary_t *in,
1320  mongocrypt_binary_t *out,
1321  mongocrypt_status_t *status);
1322 
1336 typedef bool (*mongocrypt_random_fn)(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status);
1337 
1338 MONGOCRYPT_EXPORT
1339 bool mongocrypt_setopt_crypto_hooks(mongocrypt_t *crypt,
1340  mongocrypt_crypto_fn aes_256_cbc_encrypt,
1341  mongocrypt_crypto_fn aes_256_cbc_decrypt,
1342  mongocrypt_random_fn random,
1343  mongocrypt_hmac_fn hmac_sha_512,
1344  mongocrypt_hmac_fn hmac_sha_256,
1345  mongocrypt_hash_fn sha_256,
1346  void *ctx);
1347 
1362 MONGOCRYPT_EXPORT
1364  mongocrypt_crypto_fn aes_256_ctr_encrypt,
1365  mongocrypt_crypto_fn aes_256_ctr_decrypt,
1366  void *ctx);
1367 
1382 MONGOCRYPT_EXPORT
1383 bool mongocrypt_setopt_aes_256_ecb(mongocrypt_t *crypt, mongocrypt_crypto_fn aes_256_ecb_encrypt, void *ctx);
1384 
1402 MONGOCRYPT_EXPORT
1404  mongocrypt_hmac_fn sign_rsaes_pkcs1_v1_5,
1405  void *sign_ctx);
1406 
1416 MONGOCRYPT_EXPORT
1418 
1427 MONGOCRYPT_EXPORT
1429 
1440 MONGOCRYPT_EXPORT
1441 bool mongocrypt_ctx_setopt_contention_factor(mongocrypt_ctx_t *ctx, int64_t contention_factor);
1442 
1458 MONGOCRYPT_EXPORT
1460 
1471 MONGOCRYPT_EXPORT
1472 bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len);
1473 
1492 MONGOCRYPT_EXPORT
1494 
1496 #define MONGOCRYPT_QUERY_TYPE_EQUALITY_STR "equality"
1497 // 'rangePreview' is deprecated in favor of range.
1500 #define MONGOCRYPT_QUERY_TYPE_RANGEPREVIEW_DEPRECATED_STR "rangePreview"
1501 #define MONGOCRYPT_QUERY_TYPE_RANGE_STR "range"
1502 
1503 #endif /* MONGOCRYPT_H */
struct _mongocrypt_binary_t mongocrypt_binary_t
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_encryption_key(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *bin)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_kms_provider_local(mongocrypt_t *crypt, mongocrypt_binary_t *key)
bool(* mongocrypt_hmac_fn)(void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status)
Definition: mongocrypt.h:1299
bool(* mongocrypt_crypto_fn)(void *ctx, mongocrypt_binary_t *key, mongocrypt_binary_t *iv, mongocrypt_binary_t *in, mongocrypt_binary_t *out, uint32_t *bytes_written, mongocrypt_status_t *status)
Definition: mongocrypt.h:1274
MONGOCRYPT_EXPORT mongocrypt_ctx_t * mongocrypt_ctx_new(mongocrypt_t *crypt)
MONGOCRYPT_EXPORT mongocrypt_kms_ctx_t * mongocrypt_ctx_next_kms_ctx(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_aes_256_ecb(mongocrypt_t *crypt, mongocrypt_crypto_fn aes_256_ecb_encrypt, void *ctx)
struct _mongocrypt_kms_ctx_t mongocrypt_kms_ctx_t
Definition: mongocrypt.h:1078
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_contention_factor(mongocrypt_ctx_t *ctx, int64_t contention_factor)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_masterkey_aws_endpoint(mongocrypt_ctx_t *ctx, const char *endpoint, int32_t endpoint_len)
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_endpoint(mongocrypt_kms_ctx_t *kms, const char **endpoint)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_op(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *op_bson)
MONGOCRYPT_EXPORT uint32_t mongocrypt_status_code(mongocrypt_status_t *status)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_rewrap_many_datakey_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *filter)
Initialize a context to rewrap datakeys.
MONGOCRYPT_EXPORT void mongocrypt_status_destroy(mongocrypt_status_t *status)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_encrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
MONGOCRYPT_EXPORT void mongocrypt_setopt_bypass_query_analysis(mongocrypt_t *crypt)
Opt-into skipping query analysis.
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_index_key_id(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_id)
MONGOCRYPT_EXPORT void mongocrypt_setopt_use_need_mongo_collinfo_with_db_state(mongocrypt_t *crypt)
Opt-into handling the MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB state.
MONGOCRYPT_EXPORT bool mongocrypt_status(mongocrypt_t *crypt, mongocrypt_status_t *status)
mongocrypt_log_level_t
Definition: mongocrypt.h:253
bool(* mongocrypt_hash_fn)(void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status)
Definition: mongocrypt.h:1318
MONGOCRYPT_EXPORT mongocrypt_binary_t * mongocrypt_binary_new_from_data(uint8_t *data, uint32_t len)
MONGOCRYPT_EXPORT void mongocrypt_binary_destroy(mongocrypt_binary_t *binary)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_log_handler(mongocrypt_t *crypt, mongocrypt_log_fn_t log_fn, void *log_ctx)
MONGOCRYPT_EXPORT const char * mongocrypt_kms_ctx_get_kms_provider(mongocrypt_kms_ctx_t *kms, uint32_t *len)
mongocrypt_status_type_t
Definition: mongocrypt.h:157
MONGOCRYPT_EXPORT bool mongocrypt_is_crypto_available(void)
MONGOCRYPT_EXPORT mongocrypt_status_type_t mongocrypt_status_type(mongocrypt_status_t *status)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_alt_name(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_alt_name)
MONGOCRYPT_EXPORT void mongocrypt_setopt_append_crypt_shared_lib_search_path(mongocrypt_t *crypt, const char *path)
Append an additional search directory to the search path for loading the crypt_shared dynamic library...
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_material(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_material)
MONGOCRYPT_EXPORT mongocrypt_binary_t * mongocrypt_binary_new(void)
MONGOCRYPT_EXPORT const char * mongocrypt_status_message(mongocrypt_status_t *status, uint32_t *len)
MONGOCRYPT_EXPORT uint64_t mongocrypt_crypt_shared_lib_version(const mongocrypt_t *crypt)
Obtain a 64-bit constant encoding the version of the loaded crypt_shared library, if available...
void(* mongocrypt_log_fn_t)(mongocrypt_log_level_t level, const char *message, uint32_t message_len, void *ctx)
Definition: mongocrypt.h:270
MONGOCRYPT_EXPORT bool mongocrypt_setopt_encrypted_field_config_map(mongocrypt_t *crypt, mongocrypt_binary_t *efc_map)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_done(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_provide_kms_providers(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *kms_providers_definition)
MONGOCRYPT_EXPORT const char * mongocrypt_crypt_shared_lib_version_string(const mongocrypt_t *crypt, uint32_t *len)
MONGOCRYPT_EXPORT const char * mongocrypt_ctx_mongo_db(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_feed(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes)
bool(* mongocrypt_random_fn)(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status)
Definition: mongocrypt.h:1336
MONGOCRYPT_EXPORT bool mongocrypt_ctx_status(mongocrypt_ctx_t *ctx, mongocrypt_status_t *status)
MONGOCRYPT_EXPORT bool mongocrypt_status_ok(mongocrypt_status_t *status)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_use_range_v2(mongocrypt_t *crypt)
Opt-into use of Queryable Encryption Range V2 protocol.
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_decrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
Definition: mongocrypt.h:87
MONGOCRYPT_EXPORT void mongocrypt_status_set(mongocrypt_status_t *status, mongocrypt_status_type_t type, uint32_t code, const char *message, int32_t message_len)
MONGOCRYPT_EXPORT mongocrypt_status_t * mongocrypt_status_new(void)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_aes_256_ctr(mongocrypt_t *crypt, mongocrypt_crypto_fn aes_256_ctr_encrypt, mongocrypt_crypto_fn aes_256_ctr_decrypt, void *ctx)
mongocrypt_ctx_state_t
Definition: mongocrypt.h:980
MONGOCRYPT_EXPORT bool mongocrypt_setopt_kms_provider_aws(mongocrypt_t *crypt, const char *aws_access_key_id, int32_t aws_access_key_id_len, const char *aws_secret_access_key, int32_t aws_secret_access_key_len)
MONGOCRYPT_EXPORT void mongocrypt_destroy(mongocrypt_t *crypt)
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_message(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *msg)
MONGOCRYPT_EXPORT mongocrypt_ctx_state_t mongocrypt_ctx_state(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_algorithm_range(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *opts)
MONGOCRYPT_EXPORT uint32_t mongocrypt_binary_len(const mongocrypt_binary_t *binary)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_schema_map(mongocrypt_t *crypt, mongocrypt_binary_t *schema_map)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_encrypt_init(mongocrypt_ctx_t *ctx, const char *db, int32_t db_len, mongocrypt_binary_t *cmd)
MONGOCRYPT_EXPORT uint32_t mongocrypt_kms_ctx_bytes_needed(mongocrypt_kms_ctx_t *kms)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5(mongocrypt_t *crypt, mongocrypt_hmac_fn sign_rsaes_pkcs1_v1_5, void *sign_ctx)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_feed(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *reply)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_decrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *doc)
struct _mongocrypt_ctx_t mongocrypt_ctx_t
Definition: mongocrypt.h:570
MONGOCRYPT_EXPORT bool mongocrypt_ctx_datakey_init(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_init(mongocrypt_t *crypt)
MONGOCRYPT_EXPORT void mongocrypt_setopt_set_crypt_shared_lib_path_override(mongocrypt_t *crypt, const char *path)
Set a single override path for loading the crypt_shared dynamic library.
MONGOCRYPT_EXPORT bool mongocrypt_ctx_finalize(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *out)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_id(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_id)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len)
struct _mongocrypt_t mongocrypt_t
Definition: mongocrypt.h:284
struct _mongocrypt_status_t mongocrypt_status_t
Definition: mongocrypt.h:152
MONGOCRYPT_EXPORT void mongocrypt_setopt_use_need_kms_credentials_state(mongocrypt_t *crypt)
Opt-into handling the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state.
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_masterkey_local(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_kms_done(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT mongocrypt_t * mongocrypt_new(void)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_masterkey_aws(mongocrypt_ctx_t *ctx, const char *region, int32_t region_len, const char *cmk, int32_t cmk_len)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_algorithm(mongocrypt_ctx_t *ctx, const char *algorithm, int len)
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_encrypt_expression_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
MONGOCRYPT_EXPORT const char * mongocrypt_version(uint32_t *len)
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_status(mongocrypt_kms_ctx_t *kms, mongocrypt_status_t *status)
MONGOCRYPT_EXPORT void mongocrypt_ctx_destroy(mongocrypt_ctx_t *ctx)
MONGOCRYPT_EXPORT bool mongocrypt_setopt_kms_providers(mongocrypt_t *crypt, mongocrypt_binary_t *kms_providers)
MONGOCRYPT_EXPORT uint8_t * mongocrypt_binary_data(const mongocrypt_binary_t *binary)