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
113 
121 MONGOCRYPT_EXPORT
123 
131 MONGOCRYPT_EXPORT
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
312 
322 MONGOCRYPT_EXPORT
323 bool mongocrypt_setopt_retry_kms(mongocrypt_t *crypt, bool enable);
324 
333 MONGOCRYPT_EXPORT
335 
357 MONGOCRYPT_EXPORT
359  const char *aws_access_key_id,
360  int32_t aws_access_key_id_len,
361  const char *aws_secret_access_key,
362  int32_t aws_secret_access_key_len);
363 
378 MONGOCRYPT_EXPORT
380 
392 MONGOCRYPT_EXPORT
394 
407 MONGOCRYPT_EXPORT
409 
422 MONGOCRYPT_EXPORT
424 
453 MONGOCRYPT_EXPORT
455 
479 MONGOCRYPT_EXPORT
481 
496 MONGOCRYPT_EXPORT
498 
508 MONGOCRYPT_EXPORT
510 
524 MONGOCRYPT_EXPORT
526 
536 MONGOCRYPT_EXPORT
538 
544 MONGOCRYPT_EXPORT
546 
565 MONGOCRYPT_EXPORT
566 const char *mongocrypt_crypt_shared_lib_version_string(const mongocrypt_t *crypt, uint32_t *len);
567 
587 MONGOCRYPT_EXPORT
589 
593 typedef struct _mongocrypt_ctx_t mongocrypt_ctx_t;
594 
604 MONGOCRYPT_EXPORT
606 
618 MONGOCRYPT_EXPORT
620 
635 MONGOCRYPT_EXPORT
637 
660 MONGOCRYPT_EXPORT
662 
678 MONGOCRYPT_EXPORT
680 
701 MONGOCRYPT_EXPORT
702 bool mongocrypt_ctx_setopt_algorithm(mongocrypt_ctx_t *ctx, const char *algorithm, int len);
703 
705 #define MONGOCRYPT_ALGORITHM_DETERMINISTIC_STR "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
706 #define MONGOCRYPT_ALGORITHM_RANDOM_STR "AEAD_AES_256_CBC_HMAC_SHA_512-Random"
708 #define MONGOCRYPT_ALGORITHM_INDEXED_STR "Indexed"
710 #define MONGOCRYPT_ALGORITHM_UNINDEXED_STR "Unindexed"
712 // DEPRECATED: support "RangePreview" has been removed in favor of "range".
713 #define MONGOCRYPT_ALGORITHM_RANGEPREVIEW_DEPRECATED_STR "RangePreview"
714 #define MONGOCRYPT_ALGORITHM_RANGE_STR "Range"
715 #define MONGOCRYPT_ALGORITHM_TEXTPREVIEW_STR "textPreview"
717 
736 MONGOCRYPT_EXPORT
738  const char *region,
739  int32_t region_len,
740  const char *cmk,
741  int32_t cmk_len);
742 
760 MONGOCRYPT_EXPORT
761 bool mongocrypt_ctx_setopt_masterkey_aws_endpoint(mongocrypt_ctx_t *ctx, const char *endpoint, int32_t endpoint_len);
762 
773 MONGOCRYPT_EXPORT
775 
827 MONGOCRYPT_EXPORT
829 
844 MONGOCRYPT_EXPORT
846 
861 MONGOCRYPT_EXPORT
862 bool mongocrypt_ctx_encrypt_init(mongocrypt_ctx_t *ctx, const char *db, int32_t db_len, mongocrypt_binary_t *cmd);
863 
899 MONGOCRYPT_EXPORT
901 
944 MONGOCRYPT_EXPORT
946 
960 MONGOCRYPT_EXPORT
962 
976 MONGOCRYPT_EXPORT
978 
991 MONGOCRYPT_EXPORT
993 
1000 typedef enum {
1001  MONGOCRYPT_CTX_ERROR = 0,
1002  MONGOCRYPT_CTX_NEED_MONGO_COLLINFO = 1, /* run on main MongoClient */
1003  MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB = 8, /* run on main MongoClient */
1004  MONGOCRYPT_CTX_NEED_MONGO_MARKINGS = 2, /* run on mongocryptd. */
1005  MONGOCRYPT_CTX_NEED_MONGO_KEYS = 3, /* run on key vault */
1006  MONGOCRYPT_CTX_NEED_KMS = 4,
1007  MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS = 7, /* fetch/renew KMS credentials */
1008  MONGOCRYPT_CTX_READY = 5, /* ready for encryption/decryption */
1009  MONGOCRYPT_CTX_DONE = 6,
1011 
1018 MONGOCRYPT_EXPORT
1020 
1041 MONGOCRYPT_EXPORT
1043 
1057 MONGOCRYPT_EXPORT
1059 
1082 MONGOCRYPT_EXPORT
1084 
1092 MONGOCRYPT_EXPORT
1094 
1098 typedef struct _mongocrypt_kms_ctx_t mongocrypt_kms_ctx_t;
1099 
1115 MONGOCRYPT_EXPORT
1117 
1131 MONGOCRYPT_EXPORT
1133 
1148 MONGOCRYPT_EXPORT
1149 bool mongocrypt_kms_ctx_endpoint(mongocrypt_kms_ctx_t *kms, const char **endpoint);
1150 
1157 MONGOCRYPT_EXPORT
1159 
1166 MONGOCRYPT_EXPORT
1168 
1181 MONGOCRYPT_EXPORT
1183 
1198 MONGOCRYPT_EXPORT
1200 
1208 MONGOCRYPT_EXPORT
1210 
1219 MONGOCRYPT_EXPORT
1221 
1237 MONGOCRYPT_EXPORT
1239 
1248 MONGOCRYPT_EXPORT
1250 
1265 MONGOCRYPT_EXPORT
1267 
1304 MONGOCRYPT_EXPORT
1306 
1312 MONGOCRYPT_EXPORT
1314 
1332 typedef bool (*mongocrypt_crypto_fn)(void *ctx,
1333  mongocrypt_binary_t *key,
1334  mongocrypt_binary_t *iv,
1335  mongocrypt_binary_t *in,
1336  mongocrypt_binary_t *out,
1337  uint32_t *bytes_written,
1338  mongocrypt_status_t *status);
1339 
1357 typedef bool (*mongocrypt_hmac_fn)(void *ctx,
1358  mongocrypt_binary_t *key,
1359  mongocrypt_binary_t *in,
1360  mongocrypt_binary_t *out,
1361  mongocrypt_status_t *status);
1362 
1376 typedef bool (*mongocrypt_hash_fn)(void *ctx,
1377  mongocrypt_binary_t *in,
1378  mongocrypt_binary_t *out,
1379  mongocrypt_status_t *status);
1380 
1394 typedef bool (*mongocrypt_random_fn)(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status);
1395 
1396 MONGOCRYPT_EXPORT
1397 bool mongocrypt_setopt_crypto_hooks(mongocrypt_t *crypt,
1398  mongocrypt_crypto_fn aes_256_cbc_encrypt,
1399  mongocrypt_crypto_fn aes_256_cbc_decrypt,
1400  mongocrypt_random_fn random,
1401  mongocrypt_hmac_fn hmac_sha_512,
1402  mongocrypt_hmac_fn hmac_sha_256,
1403  mongocrypt_hash_fn sha_256,
1404  void *ctx);
1405 
1420 MONGOCRYPT_EXPORT
1422  mongocrypt_crypto_fn aes_256_ctr_encrypt,
1423  mongocrypt_crypto_fn aes_256_ctr_decrypt,
1424  void *ctx);
1425 
1440 MONGOCRYPT_EXPORT
1441 bool mongocrypt_setopt_aes_256_ecb(mongocrypt_t *crypt, mongocrypt_crypto_fn aes_256_ecb_encrypt, void *ctx);
1442 
1460 MONGOCRYPT_EXPORT
1462  mongocrypt_hmac_fn sign_rsaes_pkcs1_v1_5,
1463  void *sign_ctx);
1464 
1474 MONGOCRYPT_EXPORT
1476 
1485 MONGOCRYPT_EXPORT
1487 
1498 MONGOCRYPT_EXPORT
1499 bool mongocrypt_ctx_setopt_contention_factor(mongocrypt_ctx_t *ctx, int64_t contention_factor);
1500 
1516 MONGOCRYPT_EXPORT
1518 
1529 MONGOCRYPT_EXPORT
1530 bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len);
1531 
1550 MONGOCRYPT_EXPORT
1552 
1578 MONGOCRYPT_EXPORT
1580 
1588 MONGOCRYPT_EXPORT
1589 bool mongocrypt_setopt_key_expiration(mongocrypt_t *crypt, uint64_t cache_expiration_ms);
1590 
1592 #define MONGOCRYPT_QUERY_TYPE_EQUALITY_STR "equality"
1593 // DEPRECATED: Support "rangePreview" has been removed in favor of "range".
1594 #define MONGOCRYPT_QUERY_TYPE_RANGEPREVIEW_DEPRECATED_STR "rangePreview"
1595 #define MONGOCRYPT_QUERY_TYPE_RANGE_STR "range"
1596 #define MONGOCRYPT_QUERY_TYPE_SUBSTRINGPREVIEW_STR "substringPreview"
1598 #define MONGOCRYPT_QUERY_TYPE_SUFFIXPREVIEW_STR "suffixPreview"
1600 #define MONGOCRYPT_QUERY_TYPE_PREFIXPREVIEW_STR "prefixPreview"
1602 
1603 #endif /* MONGOCRYPT_H */
mongocrypt_setopt_retry_kms
MONGOCRYPT_EXPORT bool mongocrypt_setopt_retry_kms(mongocrypt_t *crypt, bool enable)
mongocrypt_ctx_setopt_algorithm_range
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_algorithm_range(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *opts)
mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5
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_setopt_kms_provider_aws
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_setopt_use_range_v2
MONGOCRYPT_EXPORT bool mongocrypt_setopt_use_range_v2(mongocrypt_t *crypt)
mongocrypt_ctx_destroy
MONGOCRYPT_EXPORT void mongocrypt_ctx_destroy(mongocrypt_ctx_t *ctx)
mongocrypt_setopt_encrypted_field_config_map
MONGOCRYPT_EXPORT bool mongocrypt_setopt_encrypted_field_config_map(mongocrypt_t *crypt, mongocrypt_binary_t *efc_map)
mongocrypt_setopt_append_crypt_shared_lib_search_path
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_ctx_setopt_contention_factor
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_contention_factor(mongocrypt_ctx_t *ctx, int64_t contention_factor)
mongocrypt_binary_new
MONGOCRYPT_EXPORT mongocrypt_binary_t * mongocrypt_binary_new(void)
mongocrypt_ctx_kms_done
MONGOCRYPT_EXPORT bool mongocrypt_ctx_kms_done(mongocrypt_ctx_t *ctx)
mongocrypt_ctx_setopt_key_encryption_key
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_encryption_key(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *bin)
mongocrypt_new
MONGOCRYPT_EXPORT mongocrypt_t * mongocrypt_new(void)
mongocrypt_status_message
MONGOCRYPT_EXPORT const char * mongocrypt_status_message(mongocrypt_status_t *status, uint32_t *len)
mongocrypt_status_new
MONGOCRYPT_EXPORT mongocrypt_status_t * mongocrypt_status_new(void)
mongocrypt_status_code
MONGOCRYPT_EXPORT uint32_t mongocrypt_status_code(mongocrypt_status_t *status)
mongocrypt_kms_ctx_bytes_needed
MONGOCRYPT_EXPORT uint32_t mongocrypt_kms_ctx_bytes_needed(mongocrypt_kms_ctx_t *kms)
mongocrypt_status_t
struct _mongocrypt_status_t mongocrypt_status_t
Definition: mongocrypt.h:152
mongocrypt_ctx_next_kms_ctx
MONGOCRYPT_EXPORT mongocrypt_kms_ctx_t * mongocrypt_ctx_next_kms_ctx(mongocrypt_ctx_t *ctx)
mongocrypt_kms_ctx_endpoint
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_endpoint(mongocrypt_kms_ctx_t *kms, const char **endpoint)
mongocrypt_status_type
MONGOCRYPT_EXPORT mongocrypt_status_type_t mongocrypt_status_type(mongocrypt_status_t *status)
mongocrypt_ctx_rewrap_many_datakey_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_rewrap_many_datakey_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *filter)
Initialize a context to rewrap datakeys.
mongocrypt_ctx_state_t
mongocrypt_ctx_state_t
Definition: mongocrypt.h:1000
mongocrypt_ctx_t
struct _mongocrypt_ctx_t mongocrypt_ctx_t
Definition: mongocrypt.h:593
mongocrypt_status
MONGOCRYPT_EXPORT bool mongocrypt_status(mongocrypt_t *crypt, mongocrypt_status_t *status)
mongocrypt_binary_new_from_data
MONGOCRYPT_EXPORT mongocrypt_binary_t * mongocrypt_binary_new_from_data(uint8_t *data, uint32_t len)
mongocrypt_ctx_setopt_query_type
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_query_type(mongocrypt_ctx_t *ctx, const char *query_type, int len)
mongocrypt_ctx_setopt_algorithm
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_algorithm(mongocrypt_ctx_t *ctx, const char *algorithm, int len)
mongocrypt_crypt_shared_lib_version
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.
mongocrypt_setopt_log_handler
MONGOCRYPT_EXPORT bool mongocrypt_setopt_log_handler(mongocrypt_t *crypt, mongocrypt_log_fn_t log_fn, void *log_ctx)
mongocrypt_ctx_new
MONGOCRYPT_EXPORT mongocrypt_ctx_t * mongocrypt_ctx_new(mongocrypt_t *crypt)
mongocrypt_hmac_fn
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:1357
mongocrypt_ctx_explicit_encrypt_expression_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_encrypt_expression_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
mongocrypt_t
struct _mongocrypt_t mongocrypt_t
Definition: mongocrypt.h:284
mongocrypt_init
MONGOCRYPT_EXPORT bool mongocrypt_init(mongocrypt_t *crypt)
_mongocrypt_binary_t
Definition: mongocrypt.h:87
mongocrypt_binary_data
MONGOCRYPT_EXPORT uint8_t * mongocrypt_binary_data(const mongocrypt_binary_t *binary)
mongocrypt_setopt_aes_256_ctr
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_crypt_shared_lib_version_string
MONGOCRYPT_EXPORT const char * mongocrypt_crypt_shared_lib_version_string(const mongocrypt_t *crypt, uint32_t *len)
mongocrypt_version
MONGOCRYPT_EXPORT const char * mongocrypt_version(uint32_t *len)
mongocrypt_kms_ctx_status
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_status(mongocrypt_kms_ctx_t *kms, mongocrypt_status_t *status)
mongocrypt_setopt_aes_256_ecb
MONGOCRYPT_EXPORT bool mongocrypt_setopt_aes_256_ecb(mongocrypt_t *crypt, mongocrypt_crypto_fn aes_256_ecb_encrypt, void *ctx)
mongocrypt_ctx_finalize
MONGOCRYPT_EXPORT bool mongocrypt_ctx_finalize(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *out)
mongocrypt_status_set
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_ctx_decrypt_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_decrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *doc)
mongocrypt_kms_ctx_usleep
MONGOCRYPT_EXPORT int64_t mongocrypt_kms_ctx_usleep(mongocrypt_kms_ctx_t *kms)
mongocrypt_setopt_use_need_kms_credentials_state
MONGOCRYPT_EXPORT void mongocrypt_setopt_use_need_kms_credentials_state(mongocrypt_t *crypt)
Opt-into handling the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state.
mongocrypt_kms_ctx_t
struct _mongocrypt_kms_ctx_t mongocrypt_kms_ctx_t
Definition: mongocrypt.h:1098
mongocrypt_status_destroy
MONGOCRYPT_EXPORT void mongocrypt_status_destroy(mongocrypt_status_t *status)
mongocrypt_setopt_enable_multiple_collinfo
MONGOCRYPT_EXPORT bool mongocrypt_setopt_enable_multiple_collinfo(mongocrypt_t *crypt)
mongocrypt_ctx_provide_kms_providers
MONGOCRYPT_EXPORT bool mongocrypt_ctx_provide_kms_providers(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *kms_providers_definition)
mongocrypt_binary_destroy
MONGOCRYPT_EXPORT void mongocrypt_binary_destroy(mongocrypt_binary_t *binary)
mongocrypt_ctx_mongo_db
MONGOCRYPT_EXPORT const char * mongocrypt_ctx_mongo_db(mongocrypt_ctx_t *ctx)
mongocrypt_kms_ctx_fail
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_fail(mongocrypt_kms_ctx_t *kms)
mongocrypt_binary_t
struct _mongocrypt_binary_t mongocrypt_binary_t
mongocrypt_setopt_bypass_query_analysis
MONGOCRYPT_EXPORT void mongocrypt_setopt_bypass_query_analysis(mongocrypt_t *crypt)
Opt-into skipping query analysis.
mongocrypt_ctx_encrypt_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_encrypt_init(mongocrypt_ctx_t *ctx, const char *db, int32_t db_len, mongocrypt_binary_t *cmd)
mongocrypt_binary_len
MONGOCRYPT_EXPORT uint32_t mongocrypt_binary_len(const mongocrypt_binary_t *binary)
mongocrypt_ctx_setopt_key_alt_name
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_alt_name(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_alt_name)
mongocrypt_hash_fn
bool(* mongocrypt_hash_fn)(void *ctx, mongocrypt_binary_t *in, mongocrypt_binary_t *out, mongocrypt_status_t *status)
Definition: mongocrypt.h:1376
mongocrypt_ctx_setopt_key_id
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_id(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_id)
mongocrypt_ctx_setopt_masterkey_aws
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_kms_ctx_get_kms_provider
MONGOCRYPT_EXPORT const char * mongocrypt_kms_ctx_get_kms_provider(mongocrypt_kms_ctx_t *kms, uint32_t *len)
mongocrypt_kms_ctx_feed
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_feed(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes)
mongocrypt_random_fn
bool(* mongocrypt_random_fn)(void *ctx, mongocrypt_binary_t *out, uint32_t count, mongocrypt_status_t *status)
Definition: mongocrypt.h:1394
mongocrypt_ctx_setopt_algorithm_text
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_algorithm_text(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *opts)
mongocrypt_ctx_mongo_op
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_op(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *op_bson)
mongocrypt_destroy
MONGOCRYPT_EXPORT void mongocrypt_destroy(mongocrypt_t *crypt)
mongocrypt_kms_ctx_message
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_message(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *msg)
mongocrypt_ctx_explicit_encrypt_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_encrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
mongocrypt_ctx_mongo_feed
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_feed(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *reply)
mongocrypt_ctx_setopt_masterkey_local
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_masterkey_local(mongocrypt_ctx_t *ctx)
mongocrypt_setopt_set_crypt_shared_lib_path_override
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_log_level_t
mongocrypt_log_level_t
Definition: mongocrypt.h:253
mongocrypt_ctx_setopt_masterkey_aws_endpoint
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_masterkey_aws_endpoint(mongocrypt_ctx_t *ctx, const char *endpoint, int32_t endpoint_len)
mongocrypt_ctx_setopt_index_key_id
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_index_key_id(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_id)
mongocrypt_log_fn_t
void(* mongocrypt_log_fn_t)(mongocrypt_log_level_t level, const char *message, uint32_t message_len, void *ctx)
Definition: mongocrypt.h:270
mongocrypt_status_type_t
mongocrypt_status_type_t
Definition: mongocrypt.h:157
mongocrypt_setopt_kms_provider_local
MONGOCRYPT_EXPORT bool mongocrypt_setopt_kms_provider_local(mongocrypt_t *crypt, mongocrypt_binary_t *key)
mongocrypt_ctx_state
MONGOCRYPT_EXPORT mongocrypt_ctx_state_t mongocrypt_ctx_state(mongocrypt_ctx_t *ctx)
mongocrypt_ctx_mongo_done
MONGOCRYPT_EXPORT bool mongocrypt_ctx_mongo_done(mongocrypt_ctx_t *ctx)
mongocrypt_setopt_key_expiration
MONGOCRYPT_EXPORT bool mongocrypt_setopt_key_expiration(mongocrypt_t *crypt, uint64_t cache_expiration_ms)
mongocrypt_is_crypto_available
MONGOCRYPT_EXPORT bool mongocrypt_is_crypto_available(void)
mongocrypt_status_ok
MONGOCRYPT_EXPORT bool mongocrypt_status_ok(mongocrypt_status_t *status)
mongocrypt_ctx_status
MONGOCRYPT_EXPORT bool mongocrypt_ctx_status(mongocrypt_ctx_t *ctx, mongocrypt_status_t *status)
mongocrypt_ctx_explicit_decrypt_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_explicit_decrypt_init(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *msg)
mongocrypt_kms_ctx_feed_with_retry
MONGOCRYPT_EXPORT bool mongocrypt_kms_ctx_feed_with_retry(mongocrypt_kms_ctx_t *kms, mongocrypt_binary_t *bytes, bool *should_retry)
mongocrypt_setopt_kms_providers
MONGOCRYPT_EXPORT bool mongocrypt_setopt_kms_providers(mongocrypt_t *crypt, mongocrypt_binary_t *kms_providers)
mongocrypt_ctx_datakey_init
MONGOCRYPT_EXPORT bool mongocrypt_ctx_datakey_init(mongocrypt_ctx_t *ctx)
mongocrypt_setopt_use_need_mongo_collinfo_with_db_state
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_crypto_fn
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:1332
mongocrypt_setopt_schema_map
MONGOCRYPT_EXPORT bool mongocrypt_setopt_schema_map(mongocrypt_t *crypt, mongocrypt_binary_t *schema_map)
mongocrypt_ctx_setopt_key_material
MONGOCRYPT_EXPORT bool mongocrypt_ctx_setopt_key_material(mongocrypt_ctx_t *ctx, mongocrypt_binary_t *key_material)