类:Mongo::Crypt::Binding Private
Overview
此类是私有 API 的一部分。 应尽可能避免使用此类,因为它将来可能会被删除或更改。
libmongocrypt C库的Ruby绑定
常量摘要折叠
- MIN_LIBMONGOCRYPT_VERSION =
此常量是私有 API 的一部分。 应尽可能避免使用此常量,因为它将来可能会被删除或更改。
此版本的驾驶员所需的最低 libmongocrypt 版本。 尝试将该驾驶员与任何以前版本的 libmongocrypt 一起使用都会导致“LoadError”。
Gem::版本.new(" 1.12.0 ")
类方法摘要折叠
-
。 check_ctx_status (context) ⇒ nil
private
根据底层 mongocrypt_ctx_t 对象的状态引发 Mongo::Error::CryptError。
-
。 check_kms_ctx_status (kms_context) ⇒ 对象
private
如果提供的区块返回 false,则使用所提供的 KmsContext 对象中的状态信息引发 CryptError。
-
。 check_status (handle) ⇒ nil
private
根据根本的mongocrypt_t对象的状态引发 Mongo::Error::CryptError 。
-
。 crypt_shared_lib_version (处理) ⇒ 整数
private
获取64位常量,对已加载的 crypt_shared 库的版本进行编码(如果可用)。
-
。 ctx_datakey_init (context) ⇒ 对象
private
初始化上下文以创建数据密钥。
-
。 ctx_decrypt_init (context, command) ⇒ 对象
private
初始化自动解密的上下文。
-
。 ctx_encrypt_init (context, db_name, command) ⇒ 对象
private
初始化自动加密的上下文。
-
.ctx_explicit_decrypt_init(context, doc) ⇒ Object
private
为显式解密初始化上下文。
-
.ctx_explicit_encrypt_expression_init(context, doc) ⇒ Object
private
初始化显式表达式加密的上下文。
-
.ctx_explicit_encrypt_init(context, doc) ⇒ Object
private
初始化显式加密的上下文。
-
。 ctx_finalize (context) ⇒ 对象
private
完成上下文表示的状态机。
-
.ctx_kms_done(context) ⇒ Object
private
向 libmongocrypt 表明它将不再收到KMS回复。
-
。 ctx_mongo_feed (context, doc) ⇒ 对象
private
将驾驶员的响应反馈给 libmongocrypt。
-
.ctx_mongo_op(context) ⇒ BSON::Document
private
返回一个BSON::Document,表示驾驶员必须代表 libmongocrypt 执行以获取所需信息以继续加密/解密的操作(示例,用于密钥保管库查询的过滤)。
-
。 ctx_next_kms_ctx (context) ⇒ Mongo::Crypt::KmsContext | ctx_next_kms_ctx nil
private
返回 Context对象所需的新 KmsContext对象。
-
。 ctx_provide_kms_providers (context, kms_providers) ⇒ 对象
private
为响应 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS 状态而调用,以设置每个上下文的 KMS 提供程序设置。
-
。 ctx_rewrap_many_datakey_init (context, filter) ⇒ Boolean
private
初始化上下文以重新包装数据键。
-
。 ctx_setopt_algorithm (context, name) ⇒ 对象
private
根据上下文设置算法。
-
。 ctx_setopt_algorithm_range (context, opts) ⇒ 对象
private
设置使用“范围”算法进行显式加密的选项。
-
。 ctx_setopt_contention_factor (context,factor) ⇒ 对象
private
设置用于显式加密的争用因子。
-
。 ctx_setopt_key_alt_names (context, key_alt_names) ⇒ 对象
private
在创建数据密钥时设置多个备用密钥名称。
-
。 ctx_setopt_key_encryption_key (context, key_document) ⇒ 对象
private
设置用于创建数据密钥的密钥加密密钥文档。
-
.ctx_setopt_key_id(context, key_id) ⇒ Object
private
在显式加密上下文中设置密钥 ID 选项。
-
。 ctx_setopt_key_material (context, key_material) ⇒ 对象
private
设置用于加密数据的自定义密钥材料。
-
。 ctx_setopt_query_type (context, query_type) ⇒ 对象
private
设置用于 FLE 2显式加密的查询类型。
- 。 get_binary_data_direct (mongocrypt_binary_t) ⇒ 对象 private
- 。 get_binary_len_direct (mongocrypt_binary_t) ⇒ 对象 private
-
。 init (处理) ⇒ 对象
private
初始化 Mongo::Crypt::Handle 对象。
-
。 kms_ctx_bytes_needed (kms_context) ⇒ 整数
private
获取 KmsContext 所需的字节数。
-
.kms_ctx_endpoint(kms_context) ⇒ String | nil
private
获取通过 TLS 连接的主机名,以获取有关Amazon Web Services主密钥的信息。
-
。 kms_ctx_fail (kms_context) ⇒ true, false
private
检查是否可以重试上次失败的KMS上下文请求。
-
。 kms_ctx_feed (kms_context, bytes) ⇒ 对象
private
将KMS的回复反馈回 libmongocrypt。
-
。 kms_ctx_get_kms_provider (kms_context) ⇒ 对象
private
获取与此KMS请求关联的KMS提供商标识符。
-
.kms_ctx_message(kms_context) ⇒ String
private
HTTP获取从Amazon Web ServicesKMS KmsContext对象获取 主密钥所需的 消息。
-
.kms_ctx_setopt_retry_kms(handle, value) ⇒ true, fale
private
启用或禁用KMS重试行为。
-
.kms_ctx_usleep(kms_context) ⇒ Integer
private
返回在为给定KMS上下文发送KMS请求之前处于休眠状态的毫秒数。
-
。 mongocrypt_binary_data (binary) ⇒ FFI::Pointer
private
获取指向 mongocrypt_binary_t根本的数据的指针。
-
。 mongocrypt_binary_destroy (binary) ⇒ nil
private
销毁 mongocrypt_binary_t对象。
-
。 mongocrypt_binary_len (binary) ⇒ 整数
private
获取基础数据数组的长度。
-
。 mongocrypt_binary_new ⇒ FFI::Pointer
private
创建新的 mongocrypt_binary_t 对象(字节数组的非拥有视图)。
-
。 mongocrypt_binary_new_from_data (data, len) ⇒ FFI::Pointer
private
创建一个新的 mongocrypt_binary_t 对象,用于维护指向指定字节数组的指针。
- 。 mongocrypt_crypt_shared_lib_version (crypt) ⇒ 对象 private
- 。 mongocrypt_ctx_datakey_init (ctx, 过滤) ⇒ 对象 private
-
.mongocrypt_ctx_decrypt_init(ctx, doc) ⇒ Boolean
private
初始化 ctx 以进行自动解密。
-
。 mongocrypt_ctx_destroy (ctx) ⇒ nil
private
销毁对 mongocrypt_ctx_t对象的引用。
-
。 mongocrypt_ctx_encrypt_init (ctx, db, db_len, cmd) ⇒ 布尔值
private
初始化 ctx 以进行自动加密。
-
.mongocrypt_ctx_explicit_decrypt_init(ctx, msg) ⇒ Boolean
private
为显式解密初始化 ctx。
-
.mongocrypt_ctx_explicit_encrypt_init(ctx, msg) ⇒ Boolean
private
为显式表达式加密初始化 ctx。
-
。 mongocrypt_ctx_finalize (ctx, op_bson) ⇒ 布尔值
private
执行最终的加密或解密,并返回BSON文档。
-
.mongocrypt_ctx_mongo_done(ctx) ⇒ Boolean
private
指示 libmongocrypt驾驶员已完成提供回复。
-
。 mongocrypt_ctx_mongo_feed (ctx,reply) ⇒ 布尔值
private
将BSON回复发送给 libmongocrypt。
-
。 mongocrypt_ctx_mongo_next_kms_ctx (ctx) ⇒ FFI::Pointer
private
返回指向 mongocrypt_kms_ctx_t对象的指针或 NULL。
-
。 mongocrypt_ctx_mongo_op (ctx, op_bson) ⇒ 布尔值
private
获取驾驶员的BSON操作,以针对MongoDB集合、密钥保管库数据库或 mongocryptd 运行。
-
。 mongocrypt_ctx_new (crypt) ⇒ FFI::Pointer
private
创建一个新的 mongocrypt_ctx_t对象(libmongocrypt 状态机的包装器)。
- 。 mongocrypt_ctx_provide_kms_providers (ctx, kms_providers) ⇒ 对象 private
-
。 mongocrypt_ctx_setopt_algorithm (ctx, 算法, len) ⇒ Boolean
private
设置用于显式加密的算法。
- 。 mongocrypt_ctx_setopt_algorithm_range (ctx, opts) ⇒ 对象 private
- 。 mongocrypt_ctx_setopt_contention_factor (ctx,contention_factor) ⇒ 对象 private
-
。 mongocrypt_ctx_setopt_key_alt_name (ctx, binary) ⇒ Boolean
private
创建数据密钥时,请为该密钥设立备用名称。
-
。 mongocrypt_ctx_setopt_key_encryption_key (ctx) ⇒ 布尔值
private
设置用于创建数据密钥的密钥加密密钥文档。
-
.mongocrypt_ctx_setopt_key_id(ctx, key_id) ⇒ Boolean
private
设置用于显式加密的密钥 ID。
-
。 mongocrypt_ctx_setopt_key_material (ctx, binary) ⇒ Boolean
private
创建数据密钥时,请设立用于加密数据的自定义密钥材料。
- 。 mongocrypt_ctx_setopt_query_type (ctx, mongocrypt_query_type) ⇒ 对象 private
-
。 mongocrypt_ctx_state (ctx) ⇒ 符号
private
获取 ctx 的当前状态。
-
。 mongocrypt_ctx_status (ctx, status) ⇒ Boolean
private
在 mongocrypt_status_t对象上设置来自 mongocrypt_ctx_t对象的状态信息。
-
。 mongocrypt_destroy (crypt) ⇒ nil
private
销毁对 mongocrypt_t 对象的引用。
-
。 mongocrypt_init (crypt) ⇒ 布尔值
private
初始化 mongocrypt_t对象。
-
。 mongocrypt_kms_ctx_bytes_needed ( KMS ) ⇒ 整数
private
获取KMS上下文所需的字节数。
-
.mongocrypt_kms_ctx_done(ctx) ⇒ Boolean
private
指示 libmongocrypt,它将不再收到来自 mongocrypt_kms_ctx_t 对象的回复。
-
。 mongocrypt_kms_ctx_endpoint ( KMS , endpoint) ⇒ Boolean
private
获取通过 TLS 连接的主机名,以获取有关Amazon Web Services主密钥的信息。
- .mongocrypt_kms_ctx_fail(ctx) ⇒ Object private
-
。 mongocrypt_kms_ctx_feed ( KMS , bytes) ⇒ 布尔值
private
将KMS的回复反馈回 libmongocrypt。
- 。 mongocrypt_kms_ctx_get_kms_provider (crypt, kms_providers) ⇒ 对象 private
-
。 mongocrypt_kms_ctx_message ( KMS , msg) ⇒ 布尔值
private
获取获取Amazon Web Services KMS主密钥所需的消息。
-
。 mongocrypt_kms_ctx_status ( KMS , status) ⇒ 布尔值
private
将有关 mongocrypt_kms_ctx_t 对象的状态信息写入 mongocrypt_status_t 对象。
-
.mongocrypt_kms_ctx_usleep(ctx) ⇒ int64
private
指示发送KMS请求之前的休眠时间。
-
。 mongocrypt_setopt_aes_ 256 _ctr (crypt, aes_ 256 _ctr_encrypt, aes_ 256 _ctr_decrypt, ctx) ⇒ 布尔值
private
为 AES 256 -CTR 操作设置加密钩子。
- 。 mongocrypt_setopt_append_crypt_shared_lib_search_path (crypt, path) ⇒ 对象 private
- 。 mongocrypt_setopt_bypass_query_analysis (crypt) ⇒ 对象 private
-
。 mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5 (crypt, sign_rsaes_pkcs 1 _v 1 _ 5 , ctx = nil) ⇒ 布尔值
private
使用 SHA- 256哈希为 RSASSA-PKCS 1 -v 1 _ 5算法设置加密钩子。
-
。 mongocrypt_setopt_crypto_hooks (crypt, aes_enc_fn, aes_dec_fn, random_fn, sha_ 512 _fn, sha_ 256 _fn, hash_fn, ctx = nil) ="
private
在提供的 mongocrypt对象上设置加密钩子。
- 。 mongocrypt_setopt_encrypted_field_config_map (crypt, efc_map) ⇒ 对象 private
-
。 mongocrypt_setopt_kms_providers (crypt, kms_providers) ⇒ 对象
private
使用BSON文档配置KMS提供商。
-
。 mongocrypt_setopt_log_handler (crypt, log_fn, log_ctx = nil) ⇒ Boolean
private
将 mongocrypt_t 对象上的处理程序设置为在每次 libmongocrypt 记录消息时调用。
- 。 mongocrypt_setopt_retry_kms (crypt, 启用) ⇒ 对象 private
-
。 mongocrypt_setopt_schema_map (crypt, schema_map) ⇒ 布尔值
private
设置用于加密的本地模式映射。
- 。 mongocrypt_setopt_set_crypt_shared_lib_path_override (crypt, path) ⇒ 对象 private
- 。 mongocrypt_setopt_use_need_kms_credentials_state (crypt) ⇒ 对象 private
-
。 mongocrypt_status (crypt, status) ⇒ Boolean
private
在 mongocrypt_status_t对象上设置 mongocrypt_t对象的状态信息。
-
。 mongocrypt_status_code (status) ⇒ 整数
private
返回状态错误代码。
-
。 mongocrypt_status_destroy (status) ⇒ nil
private
销毁对 mongocrypt_status_t 对象的引用。
-
.mongocrypt_status_message(status, len = nil) ⇒ String
private
返回状态消息。
-
。 mongocrypt_status_new ⇒ FFI::Pointer
private
创建新的 mongocrypt_status_t 对象。
-
。 mongocrypt_status_ok (status) ⇒ 布尔值
private
返回状态是正常还是错误。
-
。 mongocrypt_status_set (status, type, code, message, len) ⇒ nil
private
在现有状态上设置消息、类型和代码。
-
.mongocrypt_status_type(status) ⇒ Symbol
private
指示状态类型。
-
。 mongocrypt_version (len) ⇒ string
private
返回 libmongocrypt 库的版本string 。
-
。 ongocrypt_new ⇒ FFI::Pointer
private
创建新的 mongocrypt_t对象。
-
.parse_version(version) ⇒ Gem::Version
private
给定一个表示版本号的string ,将其解析为一个 Gem::Version 对象。
-
。 setopt_aes_ 256 _ctr (处理, aes_ctr_encrypt_cb, aes_ctr_decrypt_cb) ⇒ 对象
private
为 AES 256 -CTR 操作设置加密钩子。
-
。 setopt_append_crypt_shared_lib_search_path (处理, path) ⇒ 对象
private
在搜索路径中追加一个搜索目录,用于加载 crypt_shared 动态库。
-
。 setopt_bypass_query_analysis (处理) ⇒ 对象
private
选择跳过查询分析。
-
。 setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5 (处理, rsaes_pkcs_signature_cb) ⇒ 对象
private
使用 SHA- 256哈希值或句柄为 RSASSA-PKCS 1 -v 1 _ 5算法设置加密钩子。
-
。 setopt_crypto_hooks (处理, aes_encrypt_cb, aes_decrypt_cb, random_cb, hmac_sha_ 512 _cb, hmac_sha_ 256 _cb, hmac_hash_cb) ⇒ 对象
private
在句柄上设置加密回调。
-
。 setopt_encrypted_field_config_map (处理, efc_map) ⇒ 对象
private
设置用于加密的本地 EncryptedFieldConfigMap。
-
。 setopt_kms_providers (处理, kms_providers) ⇒ 对象
private
在 Mongo::Crypt::Handle对象上设置KMS提供程序选项。
-
。 setopt_log_handler (handle, log_callback) ⇒ 对象
private
在 Mongo::Crypt::Handle 对象上设置记录器回调函数。
-
。 setopt_schema_map (处理, schema_map_doc) ⇒ 对象
private
在 Mongo::Crypt::Handle对象上设置模式映射。
-
。 setopt_set_crypt_shared_lib_path_override (处理, path) ⇒ 对象
private
设置用于加载 crypt 共享库的单个覆盖路径。
-
。 setopt_use_need_kms_credentials_state (处理) ⇒ 对象
private
选择处理 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS 状态。
-
.validate_document(data) ⇒ Object
private
在将指定数据序列化为 BSON 之前检查其是否为哈希,以防止 libmongocrypt 出错。
-
.validate_version(lmc_version) ⇒ Object
private
验证提供的 libmongocrypt 版本是否有效,即
实例方法摘要折叠
-
# mongocrypt_crypto_fn (ctx, key, iv, input, output, status) ⇒ Bool
private
对执行 AES加密或解密的函数的回调。
-
#mongocrypt_hash_fn(ctx, input, output, status) ⇒ Bool
private
对 SHA- 256哈希函数的回调。
-
# mongocrypt_hmac_fn (ctx, key, input, output, status) ⇒ Bool
private
对执行 HMAC SHA- 512或 SHA- 256的函数的回调。
-
# mongocrypt_log_fn_t (level, message, len, ctx) ⇒ nil
private
对 mongocrypt日志函数的回调。
-
# mongocrypt_random_fn (ctx, output, count, status) ⇒ Bool
private
对加密安全随机函数的回调。
类方法详细信息
.check_ctx_status(context) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
根据底层 mongocrypt_ctx_t 对象的状态引发 Mongo::Error::CryptError。
1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1821 def self.check_ctx_status(上下文) if block_given? do_rise = !产量 else do_rise = true end if do_rise 状态 = 状态.new mongocrypt_ctx_status(上下文.ctx_p, 状态.ref) 状态.Raise_crypt_error end end |
。 check_kms_ctx_status (kms_context) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
如果提供的区块返回 false,则使用所提供的 KmsContext 对象中的状态信息引发 CryptError。
1107 1108 1109 1110 1111 1112 1113 1114 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1107 def self.check_kms_ctx_status(kms_context) 除非 产量 状态 = 状态.new mongocrypt_kms_ctx_status(kms_context.kms_ctx_p, 状态.ref) 状态.Raise_crypt_error(KMS : true) end end |
。 check_status (处理) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
根据根本的mongocrypt_t对象的状态引发 Mongo::Error::CryptError 。
1808 1809 1810 1811 1812 1813 1814 1815 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1808 def self.check_status(处理) 除非 产量 状态 = 状态.new mongocrypt_status(处理.ref, 状态.ref) 状态.Raise_crypt_error end end |
。 crypt_shared_lib_version (处理) ⇒整数
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取64位常量,对已加载的 crypt_shared 库的版本进行编码(如果可用)。
版本从高到低编码为四个16位数字:
-
主要版本
-
次要版本
-
修订版
-
reserved
示例,版本6.2.1将编码为: 0 x 0006 ' 0002 ' 0001 ' 0000
1614 1615 1616 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1614 def self.crypt_shared_lib_version(处理) mongocrypt_crypt_shared_lib_version(处理.ref) end |
。 ctx_datakey_init (context) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化上下文以创建数据密钥
625 626 627 628 629 |
# File 'lib/ Mongo/crypt/bounding.rb', line 625 def self.ctx_datakey_init(上下文) check_ctx_status(上下文) do mongocrypt_ctx_datakey_init(上下文.ctx_p) end end |
。 ctx_decrypt_init (context, command) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化自动解密的上下文
786 787 788 789 790 791 792 793 794 |
# File 'lib/ Mongo/crypt/bounding.rb', line 786 def self.ctx_decrypt_init(上下文, 命令) validate_document(命令) 数据 = 命令.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_decrypt_init(上下文.ctx_p, data_p) end end end |
。 ctx_encrypt_init (context, db_name, command) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化自动加密的上下文
692 693 694 695 696 697 698 699 700 |
# File 'lib/ Mongo/crypt/bounding.rb', line 692 def self.ctx_encrypt_init(上下文, db_name, 命令) validate_document(命令) 数据 = 命令.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_encrypt_init(上下文.ctx_p, db_name, -1, data_p) end end end |
.ctx_explicit_decrypt_init(context, doc) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为显式解密初始化上下文
816 817 818 819 820 821 822 823 824 |
# File 'lib/ Mongo/crypt/bounding.rb', line 816 def self.ctx_explicit_decrypt_init(上下文, doc) validate_document(doc) 数据 = doc.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_explicit_decrypt_init(上下文.ctx_p, data_p) end end end |
。 ctx_explicit_encrypt_expression_init (context, doc) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化显式表达式加密的上下文。
760 761 762 763 764 765 766 767 768 |
# File 'lib/ Mongo/crypt/bounding.rb', line 760 def self.ctx_explicit_encrypt_expression_init(上下文, doc) validate_document(doc) 数据 = doc.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_explicit_encrypt_expression_init(上下文.ctx_p, data_p) end end end |
.ctx_explicit_encrypt_init(context, doc) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化显式加密的上下文
726 727 728 729 730 731 732 733 734 |
# File 'lib/ Mongo/crypt/bounding.rb', line 726 def self.ctx_explicit_encrypt_init(上下文, doc) validate_document(doc) 数据 = doc.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_explicit_encrypt_init(上下文.ctx_p, data_p) end end end |
。 ctx_finalize (context) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
最终确定 Context 表示的状态机
1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1209 def self.ctx_finalize(上下文) 二进制文件 = 二进制文件.new check_ctx_status(上下文) do mongocrypt_ctx_finalize(上下文.ctx_p, 二进制文件.ref) end # TODO,因为二进制文件引用了C指针,而 ByteBuffer 是 # 在 MRI 中用 C 语言编写,我们可以省略数据副本,方法是 # ByteBuffer 引用 libmongocrypt 拥有的string 。 BSON::文档.from_bson(BSON::ByteBuffer.new(二进制文件.to_s), 模式: :bson) end |
.ctx_kms_done(context) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
向 libmongocrypt 表明它将不再收到KMS回复。
1186 1187 1188 1189 1190 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1186 def self.ctx_kms_done(上下文) check_ctx_status(上下文) do mongocrypt_ctx_kms_done(上下文.ctx_p) end end |
。 ctx_mongo_feed (context, doc) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将驾驶员的响应反馈给 libmongocrypt
897 898 899 900 901 902 903 904 905 |
# File 'lib/ Mongo/crypt/bounding.rb', line 897 def self.ctx_mongo_feed(上下文, doc) validate_document(doc) 数据 = doc.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_mongo_feed(上下文.ctx_p, data_p) end end end |
.ctx_mongo_op(context) ⇒ BSON::Document
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回一个BSON::Document,表示驾驶员必须代表 libmongocrypt 执行以获取所需信息以继续加密/解密的操作(示例,用于密钥保管库查询的过滤)。
868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/ Mongo/crypt/bounding.rb', line 868 def self.ctx_mongo_op(上下文) 二进制文件 = 二进制文件.new check_ctx_status(上下文) do mongocrypt_ctx_mongo_op(上下文.ctx_p, 二进制文件.ref) end # TODO,因为二进制文件引用了C指针,而 ByteBuffer 是 # 在 MRI 中用 C 语言编写,我们可以省略数据副本,方法是 # ByteBuffer 引用 libmongocrypt 拥有的string 。 BSON::文档.from_bson(BSON::ByteBuffer.new(二进制文件.to_s), 模式: :bson) end |
.ctx_next_kms_ctx(context) ⇒ Mongo::Crypt::KmsContext | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回 Context对象所需的新 KmsContext对象。
929 930 931 932 933 934 935 936 937 |
# File 'lib/ Mongo/crypt/bounding.rb', line 929 def self.ctx_next_kms_ctx(上下文) kms_ctx_p = mongocrypt_ctx_next_kms_ctx(上下文.ctx_p) if kms_ctx_p.null? nil else KmsContext.new(kms_ctx_p) end end |
。 ctx_provide_kms_providers (context, kms_providers) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为响应 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS 状态而调用,以设立每个上下文的KMS提供商设置。 它们遵循与“mongocrypt_setopt_kms_providers”相同的格式。 如果BSON输入中不存在密钥,则使用初始化时为 mongocrypt_t 配置的KMS提供商设置。
1687 1688 1689 1690 1691 1692 1693 1694 1695 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1687 def self.ctx_provide_kms_providers(上下文, kms_providers) validate_document(kms_providers) 数据 = kms_providers.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_provide_kms_providers(上下文.ctx_p, data_p) end end end |
。 ctx_rewrap_many_datakey_init (context, 过滤) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化上下文以重新包装数据键。
656 657 658 659 660 661 662 663 |
# File 'lib/ Mongo/crypt/bounding.rb', line 656 def self.ctx_rewrap_many_datakey_init(上下文, 筛选器) filter_data = 筛选器.to_bson.to_s 二进制文件.wrapp_string(filter_data) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_rewrap_many_datakey_init(上下文.ctx_p, data_p) end end end |
。 ctx_setopt_algorithm (context, name) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
根据上下文设置算法
569 570 571 572 573 |
# File 'lib/ Mongo/crypt/bounding.rb', line 569 def self.ctx_setopt_algorithm(上下文, 名称) check_ctx_status(上下文) do mongocrypt_ctx_setopt_algorithm(上下文.ctx_p, 名称, -1) end end |
。 ctx_setopt_algorithm_range (context, opts) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
范围算法仅处于实验阶段。 它不适用于
设置使用“范围”算法进行显式加密的选项。
公共使用。
1794 1795 1796 1797 1798 1799 1800 1801 1802 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1794 def self.ctx_setopt_algorithm_range(上下文, opts) validate_document(opts) 数据 = opts.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_setopt_algorithm_range(上下文.ctx_p, data_p) end end end |
。 ctx_setopt_contention_factor (context,factor) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于显式加密的争用因子。 争用因子仅用于索引式 FLE 2加密。
1757 1758 1759 1760 1761 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1757 def self.ctx_setopt_contention_factor(上下文, 因素) check_ctx_status(上下文) do mongocrypt_ctx_setopt_contention_factor(上下文.ctx_p, 因素) end end |
。 ctx_setopt_key_alt_names (context, key_alt_names) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在创建数据密钥时设置多个备用密钥名称
500 501 502 503 504 505 506 507 508 509 510 |
# File 'lib/ Mongo/crypt/bounding.rb', line 500 def self.ctx_setopt_key_alt_names(上下文, key_alt_names) key_alt_names.每 do |key_alt_name| key_alt_name_bson = { :keyAltName => key_alt_name }.to_bson.to_s 二进制文件.wrapp_string(key_alt_name_bson) do |key_alt_name_p| check_ctx_status(上下文) do mongocrypt_ctx_setopt_key_alt_name(上下文.ctx_p, key_alt_name_p) end end end end |
。 ctx_setopt_key_encryption_key (context, key_document) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于创建数据密钥的密钥加密密钥文档。
598 599 600 601 602 603 604 605 606 |
# File 'lib/ Mongo/crypt/bounding.rb', line 598 def self.ctx_setopt_key_encryption_key(上下文, key_document) validate_document(key_document) 数据 = key_document.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_setopt_key_encryption_key(上下文.ctx_p, data_p) end end end |
.ctx_setopt_key_id(context, key_id) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在显式加密上下文中设置密钥 ID 选项。
467 468 469 470 471 472 473 |
# File 'lib/ Mongo/crypt/bounding.rb', line 467 def self.ctx_setopt_key_id(上下文, key_id) 二进制文件.wrapp_string(key_id) do |key_id_p| check_ctx_status(上下文) do mongocrypt_ctx_setopt_key_id(上下文.ctx_p, key_id_p) end end end |
。 ctx_setopt_key_material (context, key_material) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设立自定义密钥材料以用于
encrypting data.
535 536 537 538 539 540 541 542 |
# File 'lib/ Mongo/crypt/bounding.rb', line 535 def self.ctx_setopt_key_material(上下文, key_material) 数据 = {' keyMaterial ' => key_material}.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_ctx_status(上下文) do mongocrypt_ctx_setopt_key_material(上下文.ctx_p, data_p) end end end |
。 ctx_setopt_query_type (context, query_type) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于 FLE 2显式加密的查询类型。 查询类型仅用于索引 FLE 2加密。
1725 1726 1727 1728 1729 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1725 def self.ctx_setopt_query_type(上下文, query_type) check_ctx_status(上下文) do mongocrypt_ctx_setopt_query_type(上下文.ctx_p, query_type, -1) end end |
。 get_binary_data_direct (mongocrypt_binary_t) ⇒ 对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
181 182 183 |
# File 'lib/ Mongo/crypt/bounding.rb', line 181 def self.get_binary_data_direct(mongocrypt_binary_t) mongocrypt_binary_t.get_pointer(0) end |
。 get_binary_len_direct (mongocrypt_binary_t) ⇒ 对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
185 186 187 |
# File 'lib/ Mongo/crypt/bounding.rb', line 185 def self.get_binary_len_direct(mongocrypt_binary_t) mongocrypt_binary_t.get_uint32(FFI::NativeType::POINTER.size) end |
。 init (处理) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化 Mongo::Crypt::Handle对象
407 408 409 410 411 |
# File 'lib/ Mongo/crypt/bounding.rb', line 407 def self.init(处理) check_status(处理) do mongocrypt_init(处理.ref) end end |
。 kms_ctx_bytes_needed (kms_context) ⇒整数
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取 KmsContext 所需的字节数。
1063 1064 1065 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1063 def self.kms_ctx_bytes_needed(kms_context) mongocrypt_kms_ctx_bytes_needed(kms_context.kms_ctx_p) end |
.kms_ctx_endpoint(kms_context) ⇒ String | nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取通过 TLS 连接的主机名,以获取有关Amazon Web Services主密钥的信息。
1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1039 def self.kms_ctx_endpoint(kms_context) ptr = FFI::内存指针.new(:pointer, 1) check_kms_ctx_status(kms_context) do mongocrypt_kms_ctx_endpoint(kms_context.kms_ctx_p, ptr) end str_ptr = ptr.read_pointer str_ptr.null? ? nil : str_ptr.read_string.force_encoding('UTF-8') end |
。 kms_ctx_fail (kms_context) ⇒ true , false
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
检查是否可以重试上次失败的KMS上下文请求。
1148 1149 1150 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1148 def self.kms_ctx_fail(kms_context) mongocrypt_kms_ctx_fail(kms_context.kms_ctx_p) end |
。 kms_ctx_feed (kms_context, bytes) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将KMS的回复反馈回 libmongocrypt。
1083 1084 1085 1086 1087 1088 1089 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1083 def self.kms_ctx_feed(kms_context, 字节) check_kms_ctx_status(kms_context) do 二进制文件.wrapp_string(字节) do |bytes_p| mongocrypt_kms_ctx_feed(kms_context.kms_ctx_p, bytes_p) end end end |
。 kms_ctx_get_kms_provider (kms_context) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取与此KMS请求关联的KMS提供商标识符。
用于根据KMS请求有条件地配置 TLS 连接。 它对于 KMIP 非常有用,因为它使用客户端证书进行身份验证。
970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 |
# File 'lib/ Mongo/crypt/bounding.rb', line 970 def self.kms_ctx_get_kms_provider(kms_context) len_ptr = FFI::内存指针.new(:uint 32, 1) provider = mongocrypt_kms_ctx_get_kms_provider( kms_context.kms_ctx_p, len_ptr ) if len_ptr.nil? nil else len = if BSON::environment.jRuby? # JRuby FFI实施没有“read(type)”方法,但它 # 有这个 `get_uint 32 `。 len_ptr.get_uint32 else # 对于 MRI,我们使用已记录的“读取”方法 - http://www.Rubydoc.info/github/ffi/ffi/FFI% 2 FPointer:read len_ptr.读(:uint 32) end provider.read_string(len).to_sym end end |
。 kms_ctx_message (kms_context) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
HTTP获取从Amazon Web ServicesKMS KmsContext对象获取 主密钥所需的 消息。
1010 1011 1012 1013 1014 1015 1016 1017 1018 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1010 def self.(kms_context) 二进制文件 = 二进制文件.new check_kms_ctx_status(kms_context) do (kms_context.kms_ctx_p, 二进制文件.ref) end return 二进制文件.to_s end |
.kms_ctx_setopt_retry_kms(handle, value) ⇒ true, fale
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
启用或禁用KMS重试行为。
1167 1168 1169 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1167 def self.kms_ctx_setopt_retry_kms(处理, 值) mongocrypt_setopt_retry_kms(处理.ref, 值) end |
.kms_ctx_usleep(kms_context) ⇒ Integer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回在为给定KMS上下文发送KMS请求之前处于休眠状态的毫秒数。
1131 1132 1133 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1131 def self.kms_ctx_usleep(kms_context) mongocrypt_kms_ctx_usleep(kms_context.kms_ctx_p) end |
。 mongocrypt_binary_data (binary) ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取指向 mongocrypt_binary_t根本的数据的指针。
171 |
# File 'lib/ Mongo/crypt/bounding.rb', line 171 附加函数 :mongocrypt_binary_data, [:pointer], :pointer |
。 mongocrypt_binary_destroy (binary) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
销毁 mongocrypt_binary_t对象。
195 |
# File 'lib/ Mongo/crypt/bounding.rb', line 195 附加函数 :mongocrypt_binary_destroy, [:pointer], :void |
。 mongocrypt_binary_len (binary) ⇒整数
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取基础数据数组的长度。
179 |
# File 'lib/ Mongo/crypt/bounding.rb', line 179 附加函数 :mongocrypt_binary_len, [:pointer], :int |
。 mongocrypt_binary_new ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建一个新的 mongocrypt_binary_t对象(字节的非拥有视图)
array).
147 |
# File 'lib/ Mongo/crypt/bounding.rb', line 147 附加函数 :mongocrypt_binary_new, [], :pointer |
。 mongocrypt_binary_new_from_data (data, len) ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建一个新的 mongocrypt_binary_t 对象,该对象维护一个指向
the specified byte array.
159 160 161 162 163 |
# File 'lib/ Mongo/crypt/bounding.rb', line 159 附加函数( :mongocrypt_binary_new_from_data, [:pointer, :int], :pointer ) |
。 mongocrypt_crypt_shared_lib_version (crypt) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1592 1593 1594 1595 1596 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1592 附加函数( :mongocrypt_crypt_shared_lib_version, [ :pointer ], :uint 64 ) |
。 mongocrypt_ctx_datakey_init (ctx, filter) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
618 |
# File 'lib/ Mongo/crypt/bounding.rb', line 618 附加函数 :mongocrypt_ctx_datakey_init, [:pointer], :bool |
.mongocrypt_ctx_decrypt_init(ctx, doc) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化 ctx 以进行自动解密。
778 |
# File 'lib/ Mongo/crypt/bounding.rb', line 778 附加函数 :mongocrypt_ctx_decrypt_init, [:pointer, :pointer], :bool |
。 mongocrypt_ctx_destroy (ctx) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
销毁对 mongocrypt_ctx_t对象的引用。
1228 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1228 附加函数 :mongocrypt_ctx_destroy, [:pointer], :void |
.mongocrypt_ctx_encrypt_init(ctx, db, db_len, cmd) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
此方法要求传入的BSON采用以下格式:{ “v”: 要解密的BSON值 }。
初始化 ctx 以进行自动加密。
678 679 680 681 682 |
# File 'lib/ Mongo/crypt/bounding.rb', line 678 附加函数( :mongocrypt_ctx_encrypt_init, [:pointer, : 细绳, :int, :pointer], :bool ) |
.mongocrypt_ctx_explicit_decrypt_init(ctx, msg) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为显式解密初始化 ctx。
804 805 806 807 808 |
# File 'lib/ Mongo/crypt/bounding.rb', line 804 附加函数( :mongocrypt_ctx_explicit_decrypt_init, [:pointer, :pointer], :bool ) |
.mongocrypt_ctx_explicit_encrypt_init(ctx, msg) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用该方法之前,请使用以下方法设立key_id、key_alt_name(可选)和加密算法:mongocrypt_ctx_setopt_key_id、mongocrypt_ctx_setopt_key_alt_name 和 mongocrypt_ctx_setopt_algorithm。
为显式表达式加密初始化 ctx。
714 715 716 717 718 |
# File 'lib/ Mongo/crypt/bounding.rb', line 714 附加函数( :mongocrypt_ctx_explicit_encrypt_init, [:pointer, :pointer], :bool ) |
。 mongocrypt_ctx_finalize (ctx, op_bson) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
执行最终的加密或解密,并返回BSON文档。
1201 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1201 附加函数 :mongocrypt_ctx_finalize, [:pointer, :pointer], :void |
.mongocrypt_ctx_mongo_done(ctx) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
指示 libmongocrypt驾驶员已完成提供回复。
913 |
# File 'lib/ Mongo/crypt/bounding.rb', line 913 附加函数 :mongocrypt_ctx_mongo_done, [:pointer], :bool |
。 mongocrypt_ctx_mongo_feed (ctx,reply) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将BSON回复发送给 libmongocrypt。
889 |
# File 'lib/ Mongo/crypt/bounding.rb', line 889 附加函数 :mongocrypt_ctx_mongo_feed, [:pointer, :pointer], :bool |
。 mongocrypt_ctx_mongo_next_kms_ctx (ctx) ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回指向 mongocrypt_kms_ctx_t对象的指针或 NULL。
921 |
# File 'lib/ Mongo/crypt/bounding.rb', line 921 附加函数 :mongocrypt_ctx_next_kms_ctx, [:pointer], :pointer |
。 mongocrypt_ctx_mongo_op (ctx, op_bson) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取驾驶员的BSON操作以针对MongoDB运行
collection, the key vault database, or mongocryptd.
857 |
# File 'lib/ Mongo/crypt/bounding.rb', line 857 附加函数 :mongocrypt_ctx_mongo_op, [:pointer, :pointer], :bool |
。 mongocrypt_ctx_new (crypt) ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建一个新的 mongocrypt_ctx_t对象(libmongocrypt
state machine).
第 438 章 |
# File 'lib/ Mongo/crypt/bounding.rb', line 438 附加函数 :mongocrypt_ctx_new, [:pointer], :pointer |
。 mongocrypt_ctx_provide_kms_providers (ctx, kms_providers) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1670 1671 1672 1673 1674 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1670 附加函数( :mongocrypt_ctx_provide_kms_providers, [ :pointer, :pointer ], :bool ) |
。 mongocrypt_ctx_setopt_algorithm (ctx, 算法, len) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
设置用于显式加密的算法。
555 556 557 558 559 |
# File 'lib/ Mongo/crypt/bounding.rb', line 555 附加函数( :mongocrypt_ctx_setopt_algorithm, [:pointer, : 细绳, :int], :bool ) |
。 mongocrypt_ctx_setopt_algorithm_range (ctx, opts) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1776 1777 1778 1779 1780 1781 1782 1783 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1776 附加函数( :mongocrypt_ctx_setopt_algorithm_range, [ :pointer, :pointer ], :bool ) |
。 mongocrypt_ctx_setopt_contention_factor (ctx,contention_factor) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1741 1742 1743 1744 1745 1746 1747 1748 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1741 附加函数( :mongocrypt_ctx_setopt_contention_factor, [ :pointer, :int 64 ], :bool ) |
。 mongocrypt_ctx_setopt_key_alt_name (ctx, binary) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
创建数据密钥时,请为该密钥设立备用名称。 何时
performing explicit encryption, specifying which data key to use for
encryption based on its keyAltName field.
487 488 489 490 491 |
# File 'lib/ Mongo/crypt/bounding.rb', line 487 附加函数( :mongocrypt_ctx_setopt_key_alt_name, [:pointer, :pointer], :bool ) |
。 mongocrypt_ctx_setopt_key_encryption_key (ctx) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
设置用于创建数据密钥的密钥加密密钥文档。
585 586 587 588 589 |
# File 'lib/ Mongo/crypt/bounding.rb', line 585 附加函数( :mongocrypt_ctx_setopt_key_encryption_key, [:pointer, :pointer], :bool ) |
.mongocrypt_ctx_setopt_key_id(ctx, key_id) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
设置用于显式加密的密钥 ID。
第 459 章 |
# File 'lib/ Mongo/crypt/bounding.rb', line 459 附加函数 :mongocrypt_ctx_setopt_key_id, [:pointer, :pointer], :bool |
。 mongocrypt_ctx_setopt_key_material (ctx, binary) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
创建数据密钥材料时,设立要用于
encrypting data.
522 523 524 525 526 |
# File 'lib/ Mongo/crypt/bounding.rb', line 522 附加函数( :mongocrypt_ctx_setopt_key_material, [:pointer, :pointer], :bool ) |
。 mongocrypt_ctx_setopt_query_type (ctx, mongocrypt_query_type) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1708 1709 1710 1711 1712 1713 1714 1715 1716 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1708 附加函数( :mongocrypt_ctx_setopt_query_type, [ :pointer, : 细绳, :int ], :bool ) |
。 mongocrypt_ctx_state (ctx) ⇒符号
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取 ctx 的当前状态。
845 |
# File 'lib/ Mongo/crypt/bounding.rb', line 845 附加函数 :mongocrypt_ctx_state, [:pointer], :mongocrypt_ctx_state |
。 mongocrypt_ctx_status (ctx, status) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置来自 mongocrypt_ctx_t对象的状态信息
mongocrypt_status_t object.
第 448 章 |
# File 'lib/ Mongo/crypt/bounding.rb', line 448 附加函数 :mongocrypt_ctx_status, [:pointer, :pointer], :bool |
。 mongocrypt_destroy (crypt) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
销毁对 mongocrypt_t 对象的引用。
429 |
# File 'lib/ Mongo/crypt/bounding.rb', line 429 附加函数 :mongocrypt_destroy, [:pointer], :void |
。 mongocrypt_init (crypt) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
初始化 mongocrypt_t对象。
400 |
# File 'lib/ Mongo/crypt/bounding.rb', line 400 附加函数 :mongocrypt_init, [:pointer], :bool |
。 mongocrypt_kms_ctx_bytes_needed ( KMS ) ⇒整数
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取KMS上下文所需的字节数。
1056 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1056 附加函数 :mongocrypt_kms_ctx_bytes_needed, [:pointer], :int |
.mongocrypt_kms_ctx_done(ctx) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
向 libmongocrypt 指示它将不再收到以下回复:
mongocrypt_kms_ctx_t objects.
1179 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1179 附加函数 :mongocrypt_ctx_kms_done, [:pointer], :bool |
。 mongocrypt_kms_ctx_endpoint ( KMS , endpoint) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取通过 TLS 连接的主机名,以获取以下内容的信息:
the AWS master key.
1029 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1029 附加函数 :mongocrypt_kms_ctx_endpoint, [:pointer, :pointer], :bool |
.mongocrypt_kms_ctx_fail(ctx) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1142 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1142 附加函数 :mongocrypt_kms_ctx_fail, [:pointer], :bool |
。 mongocrypt_kms_ctx_feed ( KMS , bytes) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将KMS的回复反馈回 libmongocrypt。
1075 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1075 附加函数 :mongocrypt_kms_ctx_feed, [:pointer, :pointer], :bool |
。 mongocrypt_kms_ctx_get_kms_provider (crypt, kms_providers) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
955 956 957 958 959 |
# File 'lib/ Mongo/crypt/bounding.rb', line 955 附加函数( :mongocrypt_kms_ctx_get_kms_provider, [:pointer, :pointer], :pointer ) |
。 mongocrypt_kms_ctx_message ( KMS , msg) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
获取获取Amazon Web Services KMS主密钥所需的消息。
1000 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1000 附加函数 :mongocrypt_kms_ctx_message, [:pointer, :pointer], :bool |
。 mongocrypt_kms_ctx_status ( KMS , status) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
写入有关 mongocrypt_kms_ctx_t对象的状态信息
to the mongocrypt_status_t object.
1099 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1099 附加函数 :mongocrypt_kms_ctx_status, [:pointer, :pointer], :bool |
.mongocrypt_kms_ctx_usleep(ctx) ⇒ int64
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
指示发送KMS请求之前的休眠时间。
1123 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1123 附加函数 :mongocrypt_kms_ctx_usleep, [:pointer], :int 64 |
。 mongocrypt_setopt_aes_ 256 _ctr (crypt, aes_ 256 _ctr_encrypt, aes_ 256 _ctr_decrypt, ctx) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为 AES 256 -CTR 操作设置加密钩子。
1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1487 附加函数( :mongocrypt_setopt_aes_256_ctr, [ :pointer, :mongocrypt_crypto_fn, :mongocrypt_crypto_fn, :pointer ], :bool ) |
。 mongocrypt_setopt_append_crypt_shared_lib_search_path (crypt, path) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1525 1526 1527 1528 1529 1530 1531 1532 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1525 附加函数( :mongocrypt_setopt_append_crypt_shared_lib_search_path, [ :pointer, : 细绳, ], :void ) |
。 mongocrypt_setopt_bypass_query_analysis (crypt) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1463 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1463 附加函数(:mongocrypt_setopt_bypass_query_analysis, [:pointer], :void) |
。 mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5 (crypt, sign_rsaes_pkcs 1 _v 1 _ 5 , ctx = nil) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
使用 SHA- 256哈希为 RSASSA-PKCS 1 -v 1 _ 5算法设置加密钩子。
1380 1381 1382 1383 1384 1385 1386 1387 1388 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1380 附加函数( :mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5, [ :pointer, :mongocrypt_hmac_fn, :pointer ], :bool ) |
.mongocrypt_setopt_crypto_hooks(crypt, aes_enc_fn, aes_dec_fn, random_fn, sha_512_fn, sha_256_fn, hash_fn, ctx = nil) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在提供的 mongocrypt对象上设置加密钩子。
1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1333 附加函数( :mongocrypt_setopt_crypto_hooks, [ :pointer, :mongocrypt_crypto_fn, :mongocrypt_crypto_fn, :mongocrypt_random_fn, :mongocrypt_hmac_fn, :mongocrypt_hmac_fn, :mongocrypt_hash_fn, :pointer ], :bool ) |
。 mongocrypt_setopt_encrypted_field_config_map (crypt, efc_map) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1422 1423 1424 1425 1426 1427 1428 1429 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1422 附加函数( :mongocrypt_setopt_encrypted_field_config_map, [ :pointer, :pointer ], :bool ) |
。 mongocrypt_setopt_kms_providers (crypt, kms_providers) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在调用此方法之前,请勿初始化 ctx。
使用BSON文档配置KMS提供商。
344 345 346 347 348 |
# File 'lib/ Mongo/crypt/bounding.rb', line 344 附加函数( :mongocrypt_setopt_kms_providers, [:pointer, :pointer], :bool ) |
。 mongocrypt_setopt_log_handler (crypt, log_fn, log_ctx = nil) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将 mongocrypt_t对象上的处理程序设置为
libmongocrypt logs a message.
315 316 317 318 319 |
# File 'lib/ Mongo/crypt/bounding.rb', line 315 附加函数( :mongocrypt_setopt_log_handler, [:pointer, :mongocrypt_log_fn_t, :pointer], :bool ) |
。 mongocrypt_setopt_retry_kms (crypt, 启用) ⇒ 对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1160 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1160 附加函数 :mongocrypt_setopt_retry_kms, [:pointer, :bool], :bool |
。 mongocrypt_setopt_schema_map (crypt, schema_map) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于加密的本地模式映射。
375 |
# File 'lib/ Mongo/crypt/bounding.rb', line 375 附加函数 :mongocrypt_setopt_schema_map, [:pointer, :pointer], :bool |
。 mongocrypt_setopt_set_crypt_shared_lib_path_override (crypt, path) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1554 1555 1556 1557 1558 1559 1560 1561 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1554 附加函数( :mongocrypt_setopt_set_crypt_shared_lib_path_override, [ :pointer, : 细绳, ], :void ) |
。 mongocrypt_setopt_use_need_kms_credentials_state (crypt) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
1633 1634 1635 1636 1637 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1633 附加函数( :mongocrypt_setopt_use_need_kms_credentials_state, [ :pointer ], :void ) |
。 mongocrypt_status (crypt, status) ⇒ Boolean
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置来自 mongocrypt_t对象的状态信息
mongocrypt_status_t object.
第 421 章 |
# File 'lib/ Mongo/crypt/bounding.rb', line 421 附加函数 :mongocrypt_status, [:pointer, :pointer], :bool |
。 mongocrypt_status_code (status) ⇒整数
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回状态错误代码。
243 |
# File 'lib/ Mongo/crypt/bounding.rb', line 243 附加函数 :mongocrypt_status_code, [:pointer], :int |
。 mongocrypt_status_destroy (status) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
销毁对 mongocrypt_status_t 对象的引用。
269 |
# File 'lib/ Mongo/crypt/bounding.rb', line 269 附加函数 :mongocrypt_status_destroy, [:pointer], :void |
.mongocrypt_status_message(status, len = nil) ⇒ String
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回状态消息。
253 |
# File 'lib/ Mongo/crypt/bounding.rb', line 253 附加函数 :mongocrypt_status_message, [:pointer, :pointer], : 细绳 |
。 mongocrypt_status_new ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建新的 mongocrypt_status_t 对象。
209 |
# File 'lib/ Mongo/crypt/bounding.rb', line 209 附加函数 :mongocrypt_status_new, [], :pointer |
。 mongocrypt_status_ok (status) ⇒布尔值
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回状态是正常还是错误。
261 |
# File 'lib/ Mongo/crypt/bounding.rb', line 261 附加函数 :mongocrypt_status_ok, [:pointer], :bool |
。 mongocrypt_status_set (status, type, code, message, len) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在现有状态上设置消息、类型和代码。
223 224 225 226 227 |
# File 'lib/ Mongo/crypt/bounding.rb', line 223 附加函数( :mongocrypt_status_set, [:pointer, :status_type, :int, : 细绳, :int], :void ) |
.mongocrypt_status_type(status) ⇒ Symbol
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
指示状态类型。
235 |
# File 'lib/ Mongo/crypt/bounding.rb', line 235 附加函数 :mongocrypt_status_type, [:pointer], :status_type |
。 mongocrypt_version (len) ⇒ string
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
返回 libmongocrypt 库的版本string 。
95 |
# File 'lib/ Mongo/crypt/bounding.rb', line 95 附加函数 :mongocrypt_version, [:pointer], : 细绳 |
。 ongocrypt_new ⇒ FFI::Pointer
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
创建新的 mongocrypt_t对象。
303 |
# File 'lib/ Mongo/crypt/bounding.rb', line 303 附加函数 :mongocrypt_new, [], :pointer |
.parse_version(version) ⇒ Gem::Version
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
给定一个表示版本号的string ,将其解析为一个 Gem::Version对象。 这会通过执行一些自定义解析来处理string不是 Gem::Version 支持的格式的情况。
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/ Mongo/crypt/bounding.rb', line 108 def self.parse_version(版本) Gem::版本.new(版本) 救援 ArgumentError 匹配 = 版本.匹配(/\A(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)?(-[A-Za-z\+\d]+)?\z/) 提高 ArgumentError.new("格式不正确的版本号string #{ version } ") if 匹配.nil? Gem::版本.new( [ 匹配[:major], 匹配[:minor], 匹配[:patch] ].连接 (JOIN)(' 。 ') ) end |
。 setopt_aes_ 256 _ctr (处理, aes_ctr_encrypt_cb, aes_ctr_decrypt_cb) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为 AES 256 -CTR 操作设置加密钩子。
1505 1506 1507 1508 1509 1510 1511 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1505 def self.setopt_aes_ 256 _ctr(处理, aes_ctr_encrypt_cb, aes_ctr_decrypt_cb) check_status(处理) do mongocrypt_setopt_aes_ 256 _ctr(处理.ref, aes_ctr_encrypt_cb, aes_ctr_decrypt_cb, nil ) end end |
。 setopt_append_crypt_shared_lib_search_path (handle, path) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
将额外的Atlas Search目录附加到Atlas Search路径以进行加载
the crypt_shared dynamic library.
1539 1540 1541 1542 1543 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1539 def self.setopt_append_crypt_shared_lib_search_path(处理, 路径) check_status(处理) do mongocrypt_setopt_append_crypt_shared_lib_search_path(处理.ref, 路径) end end |
。 setopt_bypass_query_analysis (handle) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
选择跳过查询分析。
如果选择了:
-
不会尝试加载 csfle 共享库。
-
mongocrypt_ctx_t 永远不会进入 MONGOCRYPT_CTX_NEED_MARKINGS 状态。
1472 1473 1474 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1472 def self.setopt_bypass_query_analysis(处理) mongocrypt_setopt_bypass_query_analysis(处理.ref) end |
。 setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5 (处理, rsaes_pkcs_signature_cb) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
为 RSASSA-PKCS 1 -v 1 _ 5算法设置加密钩子
a SHA-256 hash oh the Handle.
1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1397 def self.setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5( 处理, rsaes_pkcs_signature_cb ) check_status(处理) do mongocrypt_setopt_crypto_hook_sign_rsaes_pkcs 1 _v 1 _ 5( 处理.ref, rsaes_pkcs_signature_cb, nil ) end end |
。 setopt_crypto_hooks (handle, aes_encrypt_cb, aes_decrypt_cb, random_cb, hmac_sha_ 512 _cb, hmac_sha_ 256 _cb, hmac_hash_cb) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在句柄上设置加密回调
1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1359 def self.setopt_crypto_hooks(处理, aes_encrypt_cb, aes_decrypt_cb, random_cb, hmac_sha_ 512 _cb, hmac_sha_ 256 _cb, hmac_hash_cb ) check_status(处理) do mongocrypt_setopt_crypto_hooks(处理.ref, aes_encrypt_cb, aes_decrypt_cb, random_cb, hmac_sha_ 512 _cb, hmac_sha_ 256 _cb, hmac_hash_cb, nil ) end end |
。 setopt_encrypted_field_config_map (处理, efc_map) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于加密的本地 EncryptedFieldConfigMap。
1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1440 def self.setopt_crypted_field_config_map(处理, efc_map) validate_document(efc_map) 数据 = efc_map.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_status(处理) do mongocrypt_setopt_encrypted_field_config_map( 处理.ref, data_p ) end end end |
。 setopt_kms_providers (处理, kms_providers) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在 Mongo::Crypt::Handle对象上设置KMS提供程序选项
357 358 359 360 361 362 363 364 365 |
# File 'lib/ Mongo/crypt/bounding.rb', line 357 def self.setopt_kms_providers(处理, kms_providers) validate_document(kms_providers) 数据 = kms_providers.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_status(处理) do mongocrypt_setopt_kms_providers(处理.ref, data_p) end end end |
。 setopt_log_handler (处理, log_callback) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在 Mongo::Crypt::Handle对象上设置记录器回调函数
327 328 329 330 331 |
# File 'lib/ Mongo/crypt/bounding.rb', line 327 def self.setopt_log_handler(处理, log_callback) check_status(处理) do mongocrypt_setopt_log_handler(处理, log_callback, nil) end end |
。 setopt_schema_map (处理, schema_map_doc) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
在 Mongo::Crypt::Handle对象上设置模式映射
384 385 386 387 388 389 390 391 392 |
# File 'lib/ Mongo/crypt/bounding.rb', line 384 def self.setopt_schema_map(处理, schema_map_doc) validate_document(schema_map_doc) 数据 = schema_map_doc.to_bson.to_s 二进制文件.wrapp_string(数据) do |data_p| check_status(处理) do mongocrypt_setopt_schema_map(处理.ref, data_p) end end end |
。 setopt_set_crypt_shared_lib_path_override (handle, path) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
设置用于加载 crypt 共享库的单个覆盖路径。
1567 1568 1569 1570 1571 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1567 def self.setopt_set_crypt_shared_lib_path_override(处理, 路径) check_status(处理) do mongocrypt_setopt_set_crypt_shared_lib_path_override(处理.ref, 路径) end end |
。 setopt_use_need_kms_credentials_state (处理) ⇒对象
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
选择处理 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS 状态。
如果设置,在进入 MONGOCRYPT_CTX_NEED_KMS 状态之前,上下文可能会进入 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS 状态,然后等待通过“mongocrypt_ctx_provide_kms_providers”提供凭证。
仅当在“mongocrypt_setopt_kms_providers”中为 KMS 提供程序设置了空文档时,上下文才会进入 MONGOCRYPT_CTX_NEED_KMS_CREDENTIALS。
1651 1652 1653 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1651 def self.setopt_use_need_kms_credentials_state(处理) mongocrypt_setopt_use_need_kms_credentials_state(处理.ref) end |
.validate_document(data) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
所有BSON::Document 实例也是哈希实例
在将指定数据序列化为BSON之前检查其是否为哈希,以防止 libmongocrypt 出错
1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1844 def self.validate_document(数据) return if 数据.is_a?(哈希) if 数据.nil? = "尝试将 nil 数据传递给 libmongocrypt。 " + " Data must be a Hash " else = "尝试将无效数据传递给 libmongocrypt: #{ data } " + " Data must be a Hash " end 提高 错误::CryptError.new() end |
.validate_version(lmc_version) ⇒ Object
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
验证提供的 libmongocrypt 版本是否有效,即等于或大于所需的最低版本。 如果没有,则引发 LoadError。
131 132 133 134 135 136 |
# File 'lib/ Mongo/crypt/bounding.rb', line 131 def self.validate_version(lmc_version) if (实际版本 = parse_version(lmc_version)) < MIN_LIBMongOCRYPT_VERSION 提高 LoadError, "需要 libmongocrypt 版本#{ MIN_LIBMongOCRYPT_VERSION }或更高版本, " + “但找到了版本#{ actual_version } 。 ” end end |
实例方法详细信息
#mongocrypt_crypto_fn(ctx, key, iv, input, output, status) ⇒ Bool
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
这定义了 FFI回调的方法签名;它不是 Binding 类的实例方法。
对执行 AES加密或解密的函数的回调。
1251 1252 1253 1254 1255 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1251 callback( :mongocrypt_crypto_fn, [:pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :bool ) |
# mongocrypt_hash_fn (ctx, input, output, status) ⇒ Bool
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
这定义了 FFI回调的方法签名;它不是 Binding 类的实例方法。
对 SHA- 256哈希函数的回调。
1299 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1299 callback :mongocrypt_hash_fn, [:pointer, :pointer, :pointer, :pointer], :bool |
# mongocrypt_hmac_fn (ctx, key, input, output, status) ⇒ Bool
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
这定义了 FFI回调的方法签名;它不是 Binding 类的实例方法。
对执行 HMAC SHA- 512或 SHA- 256的函数的回调。
1276 1277 1278 1279 1280 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1276 callback( :mongocrypt_hmac_fn, [:pointer, :pointer, :pointer, :pointer, :pointer], :bool ) |
# mongocrypt_log_fn_t (level, message, len, ctx) ⇒ nil
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
这定义了 FFI回调的方法签名;它不是 Binding 类的实例方法。
对 mongocrypt日志函数的回调。 设置自定义日志回调
with the mongocrypt_setopt_log_handler method
296 |
# File 'lib/ Mongo/crypt/bounding.rb', line 296 callback :mongocrypt_log_fn_t, [:log_level, : 细绳, :int, :pointer], :void |
# mongocrypt_random_fn (ctx, output, count, status) ⇒ Bool
此方法是私有 API 的一部分。 您应尽可能避免使用此方法,因为它将来可能会被删除或更改。
这定义了 FFI回调的方法签名;它不是 Binding 类的实例方法。
对加密安全随机函数的回调。
1317 |
# File 'lib/ Mongo/crypt/bounding.rb', line 1317 callback :mongocrypt_random_fn, [:pointer, :pointer, :int, :pointer], :bool |