Class: Mongo::Crypt::DataKeyContext Private
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Context ,
Forwardable
|
|
Instance Chain:
self,
Context
|
|
Inherits: |
Mongo::Crypt::Context
|
Defined in: | lib/mongo/crypt/data_key_context.rb |
Overview
A Context object initialized specifically for the purpose of creating a data key in the key management system.
Class Method Summary
-
.new(mongocrypt, io, master_key_document, key_alt_names, key_material) ⇒ DataKeyContext
constructor
Internal use only
Create a new
DataKeyContext
object.
Context
- Inherited
Instance Attribute Summary
Instance Method Summary
-
#initialize_ctx
private
Internal use only
Initializes the underlying mongocrypt_ctx_t object.
-
#set_key_alt_names(key_alt_names)
private
Internal use only
Set the alt names option on the context.
Context
- Inherited
#run_state_machine | Runs the mongocrypt_ctx_t state machine and handles all I/O on behalf of. |
#state | Returns the state of the mongocrypt_ctx_t. |
#azure_access_token | Returns an Azure access token, retrieving it if necessary. |
#feed_kms, | |
#gcp_access_token | Retrieves a GCP access token. |
#mongocrypt_done | Indicate that state machine is done feeding I/O responses back to libmongocrypt. |
#mongocrypt_feed | Feeds the result of a |
#provide_collection_info, #provide_keys, #provide_markings, | |
#retrieve_kms_credentials | Retrieves KMS credentials for providers that are configured for automatic credentials retrieval. |
Instance Method Details
#initialize_ctx (private)
Initializes the underlying mongocrypt_ctx_t object
# File 'lib/mongo/crypt/data_key_context.rb', line 68
def initialize_ctx Binding.ctx_datakey_init(self) end
#set_key_alt_names(key_alt_names) (private)
Set the alt names option on the context
# File 'lib/mongo/crypt/data_key_context.rb', line 52
def set_key_alt_names(key_alt_names) unless key_alt_names.is_a?(Array) raise ArgumentError.new, 'The :key_alt_names option must be an Array' end unless key_alt_names.all? { |key_alt_name| key_alt_name.is_a?(String) } raise ArgumentError.new( "#{key_alt_names} contains an invalid alternate key name. All " + "values of the :key_alt_names option Array must be Strings" ) end Binding.ctx_setopt_key_alt_names(self, key_alt_names) end