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.