lib/mongo/client_encryption.rb
def encrypt(value, opts={})
      value = { 'v': value }.to_bson.to_s

      Crypt::ExplicitEncryptionContext
        .new(@crypt_handle.ref, @encryption_io, value, opts)
        .run_state_machine
    end
# Encrypts a value using the specified encryption key and algorithm
#
# @param [ String|Numeric ] value The value to encrypt
# @param [ Hash ] opts
#
# @option [ String ] :key_id The base64-encoded UUID of the encryption
#   key as it is stored in the key vault collection
# @option [ 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"
#
# @return [ String ] The encrypted value
#
# This method is not currently unit tested.
# Find tests in spec/integration/explicit_encryption_spec.rb
Encrypts a value using the specified encryption key and algorithm
Encrypts a value using the specified encryption key and algorithm
def encrypt(value, opts={})
      value = { 'v': value }.to_bson.to_s
      Crypt::ExplicitEncryptionContext
        .new(@crypt_handle.ref, @encryption_io, value, opts)
        .run_state_machine
    end
def encrypt ( value , opts = { } ) value = { 'v' : value } . to_bson . to_s Crypt :: ExplicitEncryptionContext . new ( @crypt_handle . ref , @encryption_io , value , opts ) . run_state_machine end
Encrypts a value using the specified encryption key and algorithm
Encrypts a value using the specified encryption key and algorithm
The encrypted value This method is not currently unit tested. Find tests in spec/integration/explicit_encryption_spec.rb
The encrypted value This method is not currently unit tested . Find tests in spec / integration / explicit_encryption_spec . rb
 String 
value
opts
: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 "