Class: SimpleEncryptable::Encryptor

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_encryptable/encryptor.rb

Class Method Summary collapse

Class Method Details

.decrypt(value, options) ⇒ Object



14
15
16
17
# File 'lib/simple_encryptable/encryptor.rb', line 14

def decrypt(value, options)
  key = key(options)
  ActiveSupport::MessageEncryptor.new(key).decrypt_and_verify(value)
end

.encrypt(value, options) ⇒ Object



9
10
11
12
# File 'lib/simple_encryptable/encryptor.rb', line 9

def encrypt(value, options)
  key = key(options)
  ActiveSupport::MessageEncryptor.new(key).encrypt_and_sign(value)
end