Class: PkiExpress::PkiExpressOperator
- Inherits:
-
Object
- Object
- PkiExpress::PkiExpressOperator
- Defined in:
- lib/pki_express/pki_express_operator.rb
Direct Known Subclasses
Authentication, BaseSigner, SignatureExplorer, SignatureFinisher, TrustServicesManager
Instance Attribute Summary collapse
-
#offline ⇒ Object
Returns the value of attribute offline.
-
#signature_policy ⇒ Object
Returns the value of attribute signature_policy.
-
#timestamp_authority ⇒ Object
Returns the value of attribute timestamp_authority.
-
#trust_lacuna_test_root ⇒ Object
Returns the value of attribute trust_lacuna_test_root.
Class Method Summary collapse
Instance Method Summary collapse
- #add_file_reference(key, reference_path) ⇒ Object
- #add_trusted_root(root_path) ⇒ Object
-
#initialize(config = PkiExpressConfig.new) ⇒ PkiExpressOperator
constructor
A new instance of PkiExpressOperator.
Constructor Details
#initialize(config = PkiExpressConfig.new) ⇒ PkiExpressOperator
Returns a new instance of PkiExpressOperator.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/pki_express/pki_express_operator.rb', line 10 def initialize(config = PkiExpressConfig.new) @temp_files = [] @file_references = {} @config = config @version_manager = VersionManager.new @trusted_roots = [] @offline = false @trust_lacuna_test_root = false @signature_policy = nil = nil ObjectSpace.define_finalizer(self, self.class.method(:finalize)) end |
Instance Attribute Details
#offline ⇒ Object
Returns the value of attribute offline.
7 8 9 |
# File 'lib/pki_express/pki_express_operator.rb', line 7 def offline @offline end |
#signature_policy ⇒ Object
Returns the value of attribute signature_policy.
7 8 9 |
# File 'lib/pki_express/pki_express_operator.rb', line 7 def signature_policy @signature_policy end |
#timestamp_authority ⇒ Object
Returns the value of attribute timestamp_authority.
7 8 9 |
# File 'lib/pki_express/pki_express_operator.rb', line 7 def end |
#trust_lacuna_test_root ⇒ Object
Returns the value of attribute trust_lacuna_test_root.
7 8 9 |
# File 'lib/pki_express/pki_express_operator.rb', line 7 def trust_lacuna_test_root @trust_lacuna_test_root end |
Class Method Details
.finalize ⇒ Object
25 26 27 28 29 |
# File 'lib/pki_express/pki_express_operator.rb', line 25 def self.finalize @temp_files.each do |file| File.delete(file) if File.exist?(file) end end |
Instance Method Details
#add_file_reference(key, reference_path) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/pki_express/pki_express_operator.rb', line 31 def add_file_reference(key, reference_path) if reference_path.nil? raise ArgumentError.new('The provided reference path is not valid') end unless File.exists?(reference_path) raise ArgumentError.new('The provided reference file was not found') end @file_references[key] = reference_path end |
#add_trusted_root(root_path) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/pki_express/pki_express_operator.rb', line 44 def add_trusted_root(root_path) if root_path.nil? raise ArgumentError.new('The provided trusted root path is not valid') end unless File.exists?(root_path) raise ArgumentError.new("The provided trusted root path doesn't exist: #{root_path}") end @trusted_roots.append(root_path) end |