Class: Mongo::Crypt::RewrapManyDataKeyContext Private

Inherits:
Context
  • Object
show all
Defined in:
lib/mongo/crypt/rewrap_many_data_key_context.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 Context object initialized specifically for the purpose of rewrapping data keys (decrypting and re-rencryting using a new KEK).

Instance Attribute Summary

Attributes inherited from Context

#ctx_p

Instance Method Summary collapse

Methods inherited from Context

#run_state_machine, #state

Constructor Details

#initialize(mongocrypt, io, filter, master_key_document) ⇒ RewrapManyDataKeyContext

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.

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.



37
38
39
40
41
42
43
# File 'lib/mongo/crypt/rewrap_many_data_key_context.rb', line 37

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