Module: EncryptedField

Defined in:
lib/encrypted_field.rb,
lib/encrypted_field/version.rb,
lib/encrypted_field/action_view.rb,
lib/encrypted_field/controller_additions.rb,
lib/encrypted_field/decrypt_password_field.rb

Defined Under Namespace

Modules: ActionView, ControllerAdditions Classes: Engine, Railtie

Constant Summary collapse

VERSION =
"0.1.5"

Class Method Summary collapse

Class Method Details

.decrypt_encrypted_field(value) ⇒ Object



2
3
4
5
# File 'lib/encrypted_field/decrypt_password_field.rb', line 2

def self.decrypt_encrypted_field(value)
  @private_key ||= OpenSSL::PKey::RSA.new(File.read("#{ENV['CONFIG_CERTIFICATE_PATH']}/encrypted_field_private_key.pem"))
  @private_key.private_decrypt(Base64.decode64(value))
end