Class: Jrxades::XmlSig
- Inherits:
-
Object
- Object
- Jrxades::XmlSig
- Defined in:
- lib/jrxades/xml_sig.rb
Instance Attribute Summary collapse
-
#input_file_path ⇒ Object
Returns the value of attribute input_file_path.
-
#key_store_path ⇒ Object
Returns the value of attribute key_store_path.
-
#out_file_name ⇒ Object
Returns the value of attribute out_file_name.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#pass_phrase_for_key ⇒ Object
Returns the value of attribute pass_phrase_for_key.
-
#pass_phrase_for_key_store ⇒ Object
Returns the value of attribute pass_phrase_for_key_store.
Instance Method Summary collapse
-
#initialize(input_file_path, output_file_path, key_store_path, pass_phrase_for_key_store = nil, pass_phrase_for_key = nil) ⇒ XmlSig
constructor
A new instance of XmlSig.
- #key_data_valid? ⇒ Boolean
- #sign ⇒ Object
Constructor Details
#initialize(input_file_path, output_file_path, key_store_path, pass_phrase_for_key_store = nil, pass_phrase_for_key = nil) ⇒ XmlSig
Returns a new instance of XmlSig.
12 13 14 15 16 17 18 19 |
# File 'lib/jrxades/xml_sig.rb', line 12 def initialize(input_file_path, output_file_path, key_store_path, pass_phrase_for_key_store=nil, pass_phrase_for_key=nil) self.key_store_path = key_store_path self.pass_phrase_for_key_store = pass_phrase_for_key_store || '' self.pass_phrase_for_key = pass_phrase_for_key || '' self.output_path = File.dirname(output_file_path) self.out_file_name = File.basename(output_file_path) self.input_file_path = input_file_path end |
Instance Attribute Details
#input_file_path ⇒ Object
Returns the value of attribute input_file_path.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def input_file_path @input_file_path end |
#key_store_path ⇒ Object
Returns the value of attribute key_store_path.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def key_store_path @key_store_path end |
#out_file_name ⇒ Object
Returns the value of attribute out_file_name.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def out_file_name @out_file_name end |
#output_path ⇒ Object
Returns the value of attribute output_path.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def output_path @output_path end |
#pass_phrase_for_key ⇒ Object
Returns the value of attribute pass_phrase_for_key.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def pass_phrase_for_key @pass_phrase_for_key end |
#pass_phrase_for_key_store ⇒ Object
Returns the value of attribute pass_phrase_for_key_store.
10 11 12 |
# File 'lib/jrxades/xml_sig.rb', line 10 def pass_phrase_for_key_store @pass_phrase_for_key_store end |
Instance Method Details
#key_data_valid? ⇒ Boolean
25 26 27 28 29 30 31 |
# File 'lib/jrxades/xml_sig.rb', line 25 def key_data_valid? begin sign_test rescue Exception => e raise Jrxades::Exceptions::XmlSigException.new(e) end end |
#sign ⇒ Object
21 22 23 |
# File 'lib/jrxades/xml_sig.rb', line 21 def sign XAdESBESSignature.firmar(input_file_path, key_store_path, pass_phrase_for_key_store, output_path, out_file_name) end |