Crate mongocrypt_sys

Crate mongocrypt_sys 

Source
Expand description

FFI bindings to libmongocrypt.

These bindings are generated by rust-bindgen.

Structs§

_mongocrypt_binary_t
A non-owning view of a byte buffer.
_mongocrypt_ctx_t
_mongocrypt_kms_ctx_t
_mongocrypt_status_t
_mongocrypt_t

Constants§

mongocrypt_ctx_state_t_MONGOCRYPT_CTX_DONE
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_ERROR
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_KMS
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_MONGO_COLLINFO
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_MONGO_KEYS
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_NEED_MONGO_MARKINGS
mongocrypt_ctx_state_t_MONGOCRYPT_CTX_READY
mongocrypt_log_level_t_MONGOCRYPT_LOG_LEVEL_ERROR
mongocrypt_log_level_t_MONGOCRYPT_LOG_LEVEL_FATAL
mongocrypt_log_level_t_MONGOCRYPT_LOG_LEVEL_INFO
mongocrypt_log_level_t_MONGOCRYPT_LOG_LEVEL_TRACE
mongocrypt_log_level_t_MONGOCRYPT_LOG_LEVEL_WARNING
mongocrypt_status_type_t_MONGOCRYPT_STATUS_ERROR_CLIENT
mongocrypt_status_type_t_MONGOCRYPT_STATUS_ERROR_CRYPT_SHARED
mongocrypt_status_type_t_MONGOCRYPT_STATUS_ERROR_KMS
mongocrypt_status_type_t_MONGOCRYPT_STATUS_OK

Functions§

mongocrypt_binary_data
Get a pointer to the viewed data.
mongocrypt_binary_destroy
Free the @ref mongocrypt_binary_t.
mongocrypt_binary_len
Get the length of the viewed data.
mongocrypt_binary_new
Create a new non-owning view of a buffer (data + length).
mongocrypt_binary_new_from_data
Create a new non-owning view of a buffer (data + length).
mongocrypt_crypt_shared_lib_version
@brief Obtain a 64-bit constant encoding the version of the loaded crypt_shared library, if available.
mongocrypt_crypt_shared_lib_version_string
Obtain a nul-terminated version string of the loaded crypt_shared dynamic library, if available.
mongocrypt_ctx_datakey_init
Initialize a context to create a data key.
mongocrypt_ctx_decrypt_init
Initialize a context for decryption.
mongocrypt_ctx_destroy
Destroy and free all memory associated with a @ref mongocrypt_ctx_t.
mongocrypt_ctx_encrypt_init
Initialize a context for encryption.
mongocrypt_ctx_explicit_decrypt_init
Explicit helper method to decrypt a single BSON object.
mongocrypt_ctx_explicit_encrypt_expression_init
Explicit helper method to encrypt a Match Expression or Aggregate Expression. Contexts created for explicit encryption will not go through mongocryptd. Requires query_type to be “range”.
mongocrypt_ctx_explicit_encrypt_init
Explicit helper method to encrypt a single BSON object. Contexts created for explicit encryption will not go through mongocryptd.
mongocrypt_ctx_finalize
Perform the final encryption or decryption.
mongocrypt_ctx_kms_done
Call when done handling all KMS contexts.
mongocrypt_ctx_mongo_db
Get the database to run the mongo operation.
mongocrypt_ctx_mongo_done
Call when done feeding the reply (or replies) back to the context.
mongocrypt_ctx_mongo_feed
Feed a BSON reply or result when mongocrypt_ctx_t is in MONGOCRYPT_CTX_NEED_MONGO_* states. This may be called multiple times depending on the operation.
mongocrypt_ctx_mongo_op
Get BSON necessary to run the mongo operation when mongocrypt_ctx_t is in MONGOCRYPT_CTX_NEED_MONGO_* states.
mongocrypt_ctx_new
Create a new uninitialized @ref mongocrypt_ctx_t.
mongocrypt_ctx_next_kms_ctx
Get the next KMS handle.
mongocrypt_ctx_provide_kms_providers
Call in response to the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state to set per-context KMS provider settings. These follow the same format as @ref mongocrypt_setopt_kms_providers. If no keys are present in the BSON input, the KMS provider settings configured for the @ref mongocrypt_t at initialization are used.
mongocrypt_ctx_rewrap_many_datakey_init
@brief Initialize a context to rewrap datakeys.
mongocrypt_ctx_setopt_algorithm
Set the algorithm used for encryption to either deterministic or random encryption. This value should only be set when using explicit encryption.
mongocrypt_ctx_setopt_algorithm_range
Set options for explicit encryption with the “range” algorithm.
mongocrypt_ctx_setopt_contention_factor
Set the contention factor used for explicit encryption. The contention factor is only used for indexed Queryable Encryption.
mongocrypt_ctx_setopt_index_key_id
Set the index key id to use for explicit Queryable Encryption.
mongocrypt_ctx_setopt_key_alt_name
Set the keyAltName to use for explicit encryption or data key creation.
mongocrypt_ctx_setopt_key_encryption_key
Set key encryption key document for creating a data key or for rewrapping datakeys.
mongocrypt_ctx_setopt_key_id
Set the key id to use for explicit encryption.
mongocrypt_ctx_setopt_key_material
Set the keyMaterial to use for encrypting data.
mongocrypt_ctx_setopt_masterkey_aws
Identify the AWS KMS master key to use for creating a data key.
mongocrypt_ctx_setopt_masterkey_aws_endpoint
Identify a custom AWS endpoint when creating a data key. This is used internally to construct the correct HTTP request (with the Host header set to this endpoint). This endpoint is persisted in the new data key, and will be returned via @ref mongocrypt_kms_ctx_endpoint.
mongocrypt_ctx_setopt_masterkey_local
Set the master key to “local” for creating a data key. This has been superseded by the more flexible: @ref mongocrypt_ctx_setopt_key_encryption_key
mongocrypt_ctx_setopt_query_type
Set the query type to use for explicit Queryable Encryption.
mongocrypt_ctx_state
Get the current state of a context.
mongocrypt_ctx_status
Get the status associated with a @ref mongocrypt_ctx_t object.
mongocrypt_destroy
Destroy the @ref mongocrypt_t object.
mongocrypt_init
Initialize new @ref mongocrypt_t object.
mongocrypt_is_crypto_available
Returns true if libmongocrypt was built with native crypto support.
mongocrypt_kms_ctx_bytes_needed
Indicates how many bytes to feed into @ref mongocrypt_kms_ctx_feed.
mongocrypt_kms_ctx_endpoint
Get the hostname from which to connect over TLS.
mongocrypt_kms_ctx_fail
Indicate a network-level failure.
mongocrypt_kms_ctx_feed
Feed bytes from the HTTP response.
mongocrypt_kms_ctx_get_kms_provider
Get the KMS provider identifier associated with this KMS request.
mongocrypt_kms_ctx_message
Get the HTTP request message for a KMS handle.
mongocrypt_kms_ctx_status
Get the status associated with a @ref mongocrypt_kms_ctx_t object.
mongocrypt_kms_ctx_usleep
Indicates how long to sleep before sending this request.
mongocrypt_new
Allocate a new @ref mongocrypt_t object.
mongocrypt_setopt_aes_256_ctr
Set a crypto hook for the AES256-CTR operations.
mongocrypt_setopt_aes_256_ecb
Set an AES256-ECB crypto hook for the AES256-CTR operations. If CTR hook was configured using @ref mongocrypt_setopt_aes_256_ctr, ECB hook will be ignored.
mongocrypt_setopt_append_crypt_shared_lib_search_path
@brief Append an additional search directory to the search path for loading the crypt_shared dynamic library.
mongocrypt_setopt_bypass_query_analysis
@brief Opt-into skipping query analysis.
mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs1_v1_5
Set a crypto hook for the RSASSA-PKCS1-v1_5 algorithm with a SHA-256 hash.
mongocrypt_setopt_crypto_hooks
mongocrypt_setopt_encrypted_field_config_map
Set a local EncryptedFieldConfigMap for encryption.
mongocrypt_setopt_key_expiration
Set the expiration time for the data encryption key cache. Defaults to 60 seconds if not set.
mongocrypt_setopt_kms_provider_aws
Configure an AWS KMS provider on the @ref mongocrypt_t object.
mongocrypt_setopt_kms_provider_local
Configure a local KMS provider on the @ref mongocrypt_t object.
mongocrypt_setopt_kms_providers
Configure KMS providers with a BSON document.
mongocrypt_setopt_log_handler
Set a handler on the @ref mongocrypt_t object to get called on every log message.
mongocrypt_setopt_retry_kms
Enable or disable KMS retry behavior.
mongocrypt_setopt_schema_map
Set a local schema map for encryption.
mongocrypt_setopt_set_crypt_shared_lib_path_override
@brief Set a single override path for loading the crypt_shared dynamic library.
mongocrypt_setopt_use_need_kms_credentials_state
@brief Opt-into handling the MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS state.
mongocrypt_setopt_use_need_mongo_collinfo_with_db_state
@brief Opt-into handling the MONGOCRYPT_CTX_NEED_MONGO_COLLINFO_WITH_DB state.
mongocrypt_setopt_use_range_v2
DEPRECATED: Use of mongocrypt_setopt_use_range_v2 is deprecated. Range V2 is always enabled.
mongocrypt_status
Get the status associated with a @ref mongocrypt_t object.
mongocrypt_status_code
Get an error code or 0.
mongocrypt_status_destroy
Free the memory for a status object.
mongocrypt_status_message
Get the error message associated with a status or NULL.
mongocrypt_status_new
Create a new status object.
mongocrypt_status_ok
Returns true if the status indicates success.
mongocrypt_status_set
Set a status object with message, type, and code.
mongocrypt_status_type
Indicates success or the type of error.
mongocrypt_version
Returns the version string for libmongocrypt.

Type Aliases§

mongocrypt_binary_t
A non-owning view of a byte buffer.
mongocrypt_crypto_fn
An crypto AES-256-CBC encrypt or decrypt function.
mongocrypt_ctx_state_t
Indicates the state of the @ref mongocrypt_ctx_t. Each state requires different handling. See the integration guide for information on what to do for each state.
mongocrypt_ctx_t
Manages the state machine for encryption or decryption.
mongocrypt_hash_fn
A crypto hash (SHA-256) function.
mongocrypt_hmac_fn
A crypto signature or HMAC function.
mongocrypt_kms_ctx_t
Manages a single KMS HTTP request/response.
mongocrypt_log_fn_t
A log callback function. Set a custom log callback with @ref mongocrypt_setopt_log_handler.
mongocrypt_log_level_t
Indicates the type of log message.
mongocrypt_random_fn
A crypto secure random function.
mongocrypt_status_t
Indicates success or contains error information.
mongocrypt_status_type_t
Indicates the type of error.
mongocrypt_t
The top-level handle to libmongocrypt.