Class: MyPKI::CA
- Inherits:
-
Object
- Object
- MyPKI::CA
- Includes:
- MyPKI::Configuration::Loader, Prompter
- Defined in:
- lib/mypki/loaders/ca.rb
Constant Summary collapse
- DEFAULT_PATH =
'/etc/pki/tls/certs/ca-bundle.crt'
Instance Attribute Summary
Attributes included from MyPKI::Configuration::Loader
Instance Method Summary collapse
Methods included from MyPKI::Configuration::Loader
Methods included from Prompter
#file_prompt, #pass_prompt, #prompter
Instance Method Details
#configure(config, path) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/mypki/loaders/ca.rb', line 10 def configure config, path if File.readable? DEFAULT_PATH config['ca'] = DEFAULT_PATH elsif config['ca'].nil? prompt = "Path to CA chains (press enter to skip): " path = file_prompt prompt, required: false if path.nil? config['ca'] = '' else if File.directory? path fail "'#{path}' is a directory" elsif not File.readable? path fail "Cannot read '#{path}'" else config['ca'] = path end end end end |