lib/trocla/encryptions/ssl.rb in trocla-0.1.2 vs lib/trocla/encryptions/ssl.rb in trocla-0.2.0

- old
+ new

@@ -23,22 +23,20 @@ def chunksize public_key.n.num_bytes - 11 end def private_key - pass = nil - file = require_option(:private_key) - @private_key ||= OpenSSL::PKey::RSA.new(File.read(file), nil) + @private_key ||= begin + file = require_option(:private_key) + OpenSSL::PKey::RSA.new(File.read(file), nil) + end end def public_key - file = require_option(:public_key) - @public_key ||= OpenSSL::PKey::RSA.new(File.read(file), nil) - end - - def config - @config = @trocla.config['ssl_options'] - @config ||= Hash.new + @public_key ||= begin + file = require_option(:public_key) + OpenSSL::PKey::RSA.new(File.read(file), nil) + end end def option(key) config[key] end