Module: Strongbox

Defined in:
lib/strongbox.rb,
lib/strongbox/lock.rb,
lib/strongbox/cipher.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Cipher, Lock, StrongboxError

Constant Summary collapse

VERSION =
"0.7.3"
RSA_PKCS1_PADDING =
OpenSSL::PKey::RSA::PKCS1_PADDING
RSA_SSLV23_PADDING =
OpenSSL::PKey::RSA::SSLV23_PADDING
RSA_NO_PADDING =
OpenSSL::PKey::RSA::NO_PADDING
RSA_PKCS1_OAEP_PADDING =
OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



29
30
31
32
33
34
# File 'lib/strongbox.rb', line 29

def included base #:nodoc:
  base.extend ClassMethods
  if base.respond_to?(:class_attribute)
    base.class_attribute :lock_options
  end
end

.optionsObject

Provides for setting the default options for Strongbox



18
19
20
21
22
23
24
25
26
27
# File 'lib/strongbox.rb', line 18

def options
  @options ||= {
    :base64 => false,
    :symmetric => :always,
    :padding => RSA_PKCS1_PADDING,
    :symmetric_cipher => 'aes-256-cbc',
    :ensure_required_columns => true,
    :deferred_encryption => false
  }
end