Method: Mongo::Crypt::ExplicitEncrypter#encrypt
- Defined in:
- lib/mongo/crypt/explicit_encrypter.rb
#encrypt(value, options) ⇒ BSON::Binary
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.
Note:
The :key_id and :key_alt_name options are mutually exclusive. Only one is required to perform explicit encryption.
Encrypts a value using the specified encryption key and algorithm
if encryption algorithm is set to “Indexed”. Query type should be set
only if encryption algorithm is set to "Indexed". The only allowed
value is "equality".
113 114 115 116 117 118 119 120 |
# File 'lib/mongo/crypt/explicit_encrypter.rb', line 113 def encrypt(value, ) Crypt::ExplicitEncryptionContext.new( @crypt_handle, @encryption_io, { v: value }, ).run_state_machine(timeout_holder)['v'] end |