lib/mongo/client_encryption.rb
# Generates a data key used for encryption/decryption and stores
# that key in the KMS collection. The generated key is encrypted with
# the KMS master key.
#
# @return [ String ] Base64-encoded UUID string representing the
#   data key _id
Generates a data key used for encryption/decryption and stores
that key in the KMS collection. The generated key is encrypted with
the KMS master key.
Generates a data key used for encryption / decryption and stores that key in the KMS collection . The generated key is encrypted with the KMS master key .
def create_data_key
      result = Crypt::DataKeyContext.new(@crypt_handle.ref).run_state_machine
      data_key_document = Hash.from_bson(BSON::ByteBuffer.new(result))
      insert_result = @encryption_io.insert(data_key_document)
      return insert_result.inserted_id.data
    end
def create_data_key result = Crypt :: DataKeyContext . new ( @crypt_handle . ref ) . run_state_machine data_key_document = Hash . from_bson ( BSON :: ByteBuffer . new ( result ) ) insert_result = @encryption_io . insert ( data_key_document ) return insert_result . inserted_id . data end
Generates a data key used for encryption/decryption and stores
that key in the KMS collection.
Generates a data key used for encryption / decryption and stores that key in the KMS collection .
Base64-encoded UUID string representing the data key _id
Base64 - encoded UUID string representing the data key _id
 String 