Class: Mongo::Crypt::Handle Private
- Inherits:
-
Object
- Object
- Mongo::Crypt::Handle
- Defined in:
- build/ruby-driver-master/lib/mongo/crypt/handle.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A handle to the libmongocrypt library that wraps a mongocrypt_t object, allowing clients to set options on that object or perform operations such as encryption and decryption
Instance Method Summary collapse
-
#initialize(kms_providers, kms_tls_options, options = {}) ⇒ Handle
constructor
private
Creates a new Handle object and initializes it with options.
-
#kms_tls_options(provider) ⇒ Hash
private
Return TLS options for KMS provider.
-
#ref ⇒ FFI::Pointer
private
Return the reference to the underlying @mongocrypt object.
Constructor Details
#initialize(kms_providers, kms_tls_options, options = {}) ⇒ Handle
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a new Handle object and initializes it with options
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'build/ruby-driver-master/lib/mongo/crypt/handle.rb', line 44 def initialize(kms_providers, , ={}) # FFI::AutoPointer uses a custom release strategy to automatically free # the pointer once this object goes out of scope @mongocrypt = FFI::AutoPointer.new( Binding.mongocrypt_new, Binding.method(:mongocrypt_destroy) ) @kms_tls_options = @schema_map = [:schema_map] set_schema_map if @schema_map @logger = [:logger] set_logger_callback if @logger set_crypto_hooks Binding.setopt_kms_providers(self, kms_providers.to_document) initialize_mongocrypt end |
Instance Method Details
#kms_tls_options(provider) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return TLS options for KMS provider. If there are no TLS options set, empty hash is returned.
79 80 81 |
# File 'build/ruby-driver-master/lib/mongo/crypt/handle.rb', line 79 def (provider) @kms_tls_options.fetch(provider, {}) end |
#ref ⇒ FFI::Pointer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return the reference to the underlying @mongocrypt object
69 70 71 |
# File 'build/ruby-driver-master/lib/mongo/crypt/handle.rb', line 69 def ref @mongocrypt end |