lib/mongo/crypt/explicit_encrypter.rb
def encrypt(value, options)
        Crypt::ExplicitEncryptionContext.new(
          @crypt_handle,
          @encryption_io,
          { 'v': value },
          options
        ).run_state_machine['v']
      end
# Encrypts a value using the specified encryption key and algorithm
#
# @param [ Object ] value The value to encrypt
# @param [ Hash ] options
#
# @option options [ BSON::Binary ] :key_id A BSON::Binary object of type :uuid
#   representing the UUID of the encryption key as it is stored in the key
#   vault collection.
# @option options [ String ] :key_alt_name The alternate name for the
#   encryption key.
# @option options [ String ] :algorithm The algorithm used to encrypt the value.
#   Valid algorithms are "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"
#   or "AEAD_AES_256_CBC_HMAC_SHA_512-Random".
#
# @note The :key_id and :key_alt_name options are mutually exclusive. Only
#   one is required to perform explicit encryption.
#
# @return [ BSON::Binary ] A BSON Binary object of subtype 6 (ciphertext)
#   representing the encrypted value
Encrypts a value using the specified encryption key and algorithm
Encrypts a value using the specified encryption key and algorithm
def encrypt(value, options)
        Crypt::ExplicitEncryptionContext.new(
          @crypt_handle,
          @encryption_io,
          { 'v': value },
          options
        ).run_state_machine['v']
      end
def encrypt ( value , options ) Crypt :: ExplicitEncryptionContext . new ( @crypt_handle , @encryption_io , { 'v' : value } , options ) . run_state_machine [ 'v' ] end
Encrypts a value using the specified encryption key and algorithm
Encrypts a value using the specified encryption key and algorithm
A BSON Binary object of subtype 6 (ciphertext) representing the encrypted value
A BSON Binary object of subtype 6 ( ciphertext ) representing the encrypted value
 BSON::Binary 
value
options
:algorithm The algorithm used to encrypt the value. Valid algorithms are "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic" or "AEAD_AES_256_CBC_HMAC_SHA_512-Random".
: algorithm The algorithm used to encrypt the value . Valid algorithms are " AEAD_AES_256_CBC_HMAC_SHA_512 - Deterministic " or " AEAD_AES_256_CBC_HMAC_SHA_512 - Random " .
None
note
The :key_id and :key_alt_name options are mutually exclusive. Only one is required to perform explicit encryption.
The : key_id and : key_alt_name options are mutually exclusive . Only one is required to perform explicit encryption .