123456789_123456789_123456789_123456789_123456789_

Class: Mongo::Crypt::RewrapManyDataKeyContext 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/rewrap_many_data_key_context.rb

Overview

A Context object initialized specifically for the purpose of rewrapping data keys (decrypting and re-encrypting using a new KEK).

Class Method Summary

Context - Inherited

.new

Create a new Context object.

Instance Attribute Summary

Context - Inherited

Instance Method Summary

Context - Inherited

#bson_mode

Which BSON mode to use when creating documents from the outcome of the state machine.

#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_collection_info, #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 ::Mongo operation back to libmongocrypt.

#provide_collection_info, #provide_collection_info_with_db, #provide_keys, #provide_markings,
#retrieve_kms_credentials

Retrieves KMS credentials for providers that are configured for automatic credentials retrieval.

Constructor Details

.new(mongocrypt, io, filter, master_key_document) ⇒ RewrapManyDataKeyContext

Create a new RewrapManyDataKeyContext object

Parameters:

  • mongocrypt (Mongo::Crypt::Handle)

    a Handle that wraps a mongocrypt_t object used to create a new mongocrypt_ctx_t

  • io (Mongo::Crypt::EncryptionIO)

    An object that performs all driver I/O on behalf of libmongocrypt

  • filter (Hash)

    Filter used to find keys to be updated. alternate names for the new data key.

  • master_key_document (Mongo::Crypt::KMS::MasterKeyDocument | nil)

    The optional master key document that contains master encryption key parameters.

[ GitHub ]

  
# File 'lib/mongo/crypt/rewrap_many_data_key_context.rb', line 34

def initialize(mongocrypt, io, filter, master_key_document)
  super(mongocrypt, io)
  Binding.ctx_setopt_key_encryption_key(self, master_key_document.to_document) if master_key_document
  Binding.ctx_rewrap_many_datakey_init(self, filter)
end