Class: EncryptedCookieStore::EncryptedCookieStore

Inherits:
ActionDispatch::Session::CookieStore
  • Object
show all
Includes:
EncryptedCookieStoreConstants
Defined in:
lib/encrypted_cookie_store/encrypted_cookie_store.rb

Defined Under Namespace

Classes: MessageVerifier

Constant Summary collapse

OpenSSLCipherError =
OpenSSL::Cipher.const_defined?(:CipherError) ? OpenSSL::Cipher::CipherError : OpenSSL::CipherError

Constants included from EncryptedCookieStoreConstants

EncryptedCookieStoreConstants::ENCRYPTION_KEY_SIZE

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ EncryptedCookieStore

Returns a new instance of EncryptedCookieStore.



17
18
19
20
21
22
23
# File 'lib/encrypted_cookie_store/encrypted_cookie_store.rb', line 17

def initialize(app, options = {})
  ensure_encryption_key_secure(options[:encryption_key])
  @encryption_key = unhex(options[:encryption_key]).freeze
  @iv_cipher      = OpenSSL::Cipher::Cipher.new(EncryptedCookieStore.iv_cipher_type)
  @data_cipher    = OpenSSL::Cipher::Cipher.new(EncryptedCookieStore.data_cipher_type)
  super(app, options)
end

Class Attribute Details

.data_cipher_typeObject

Returns the value of attribute data_cipher_type.



11
12
13
# File 'lib/encrypted_cookie_store/encrypted_cookie_store.rb', line 11

def data_cipher_type
  @data_cipher_type
end

.iv_cipher_typeObject

Returns the value of attribute iv_cipher_type.



10
11
12
# File 'lib/encrypted_cookie_store/encrypted_cookie_store.rb', line 10

def iv_cipher_type
  @iv_cipher_type
end