Class: InlineEncryption::Config
- Inherits:
-
Hash
- Object
- Hash
- InlineEncryption::Config
- Includes:
- Hashie::Extensions::IndifferentAccess, Hashie::Extensions::MethodAccess
- Defined in:
- lib/inline_encryption/config.rb
Overview
known configuration variables key - a String containing the private key, a filename pointing to the private key, or an OpenSSL::PKey::RSA
Instance Method Summary collapse
-
#check_required_variables ⇒ Object
checks required, currently only the ‘key’.
-
#real_key ⇒ OpenSSL::PKey::RSA
The OpenSSL key instance.
Instance Method Details
#check_required_variables ⇒ Object
checks required, currently only the ‘key’
19 20 21 |
# File 'lib/inline_encryption/config.rb', line 19 def check_required_variables raise MissingRequiredVariableError, I18n.t('error.missing_key') unless key?(:key) end |
#real_key ⇒ OpenSSL::PKey::RSA
Returns the OpenSSL key instance.
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/inline_encryption/config.rb', line 24 def real_key case self[:key] when NilClass nil when String load_or_use_key(self[:key]) when OpenSSL::PKey::RSA self[:key] end end |