lib/crypt_keeper/model.rb
# Public: Setup fields for encryption
#
#   args - An array of fields to encrypt. The last argument should be
#   a hash of options. Note, an :encryptor is required. This should be
#   a class that takes a hash for initialize and provides an encrypt
#   and decrypt method.
#
# Example
#
#   class MyModel < ActiveRecord::Base
#     crypt_keeper :field, :other_field, :encryptor => :aes, :key => 'super_good_password'
#   end
#
Setup fields for encryption
args - An array of fields to encrypt. The last argument should be
a hash of options. Note, an :encryptor is required. This should be
a class that takes a hash for initialize and provides an encrypt
and decrypt method.

Example


Setup fields for encryption args - An array of fields to encrypt . The last argument should be a hash of options . Note an : encryptor is required . This should be a class that takes a hash for initialize and provides an encrypt and decrypt method . Example
def search_by_plaintext(field, criteria)
        if crypt_keeper_fields.include?(field.to_sym)
          encryptor = encryptor_klass.new(crypt_keeper_options)
          encryptor.search(scoping_strategy, field.to_s, criteria)
        else
          raise "#{field} is not a crypt_keeper field"
        end
      end
def search_by_plaintext ( field , criteria ) if crypt_keeper_fields . include? ( field . to_sym ) encryptor = encryptor_klass . new ( crypt_keeper_options ) encryptor . search ( scoping_strategy , field . to_s , criteria ) else raise "#{field} is not a crypt_keeper field" end end
Public: Setup fields for encryption
args - An array of fields to encrypt.
Public : Setup fields for encryption args - An array of fields to encrypt .
field
<not_specific>
criteria
<not_specific>