Class: Serket::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/serket/configuration.rb

Overview

Controls various configuration options such as key locations, desired algorithms and expected cipher text format.

  • private_key_path - The filepath to a RSA private key

  • public_key_path - The filepath to a RSA public key

  • delimiter - If the format is set to :delimited, use this delimiter.

    Must not be a character in base64.
    
  • format - May be :delimited or :json

  • symmetric_algorithm - May be any algorithm that may be used with OpenSSL::Cipher

  • encoding - Any valid ruby encoding

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



16
17
18
19
20
21
# File 'lib/serket/configuration.rb', line 16

def initialize
  @delimiter = "::"
  @format = :delimited
  @symmetric_algorithm = 'AES-256-CBC'
  @encoding = 'utf-8'
end

Instance Attribute Details

#delimiterObject

Returns the value of attribute delimiter.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def delimiter
  @delimiter
end

#encodingObject

Returns the value of attribute encoding.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def encoding
  @encoding
end

#formatObject

Returns the value of attribute format.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def format
  @format
end

#private_key_pathObject

Returns the value of attribute private_key_path.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def private_key_path
  @private_key_path
end

#public_key_pathObject

Returns the value of attribute public_key_path.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def public_key_path
  @public_key_path
end

#symmetric_algorithmObject

Returns the value of attribute symmetric_algorithm.



14
15
16
# File 'lib/serket/configuration.rb', line 14

def symmetric_algorithm
  @symmetric_algorithm
end