Class: RestPki::XmlSignatureStarter

Inherits:
SignatureStarter show all
Defined in:
lib/rest_pki/xml_signature_starter.rb

Instance Attribute Summary

Attributes inherited from SignatureStarter

#callback_argument, #ignore_revocation_status_unknown, #security_context_id, #signature_policy_id

Instance Method Summary collapse

Methods inherited from SignatureStarter

#certificate, #signer_certificate=, #signer_certificate_base64=, #start, #start_with_webpki

Constructor Details

#initialize(restpki_client) ⇒ XmlSignatureStarter

Returns a new instance of XmlSignatureStarter.



6
7
8
9
10
11
12
13
# File 'lib/rest_pki/xml_signature_starter.rb', line 6

def initialize(restpki_client)
    super(restpki_client)
    @xml_content_base64 = nil
    @signature_element_id = nil
    @xpath = nil
    @insertion_option = nil
    @namespace_manager = nil
end

Instance Method Details

#set_signature_element_location(xpath, insertion_option, namespace_manager = nil) ⇒ Object

endregion



43
44
45
46
47
# File 'lib/rest_pki/xml_signature_starter.rb', line 43

def set_signature_element_location(xpath, insertion_option, namespace_manager=nil)
    @xpath = xpath
    @insertion_option = insertion_option
    @namespace_manager = namespace_manager
end

#set_xml_content_tosign(content_raw) ⇒ Object



33
34
35
# File 'lib/rest_pki/xml_signature_starter.rb', line 33

def set_xml_content_tosign(content_raw)
    set_xml_tosign_from_raw(content_raw)
end

#set_xml_file_tosign(xml_path) ⇒ Object



37
38
39
# File 'lib/rest_pki/xml_signature_starter.rb', line 37

def set_xml_file_tosign(xml_path)
    set_xml_tosign_from_path(xml_path)
end

#set_xml_tosign_from_base64(content_base64) ⇒ Object



29
30
31
# File 'lib/rest_pki/xml_signature_starter.rb', line 29

def set_xml_tosign_from_base64(content_base64)
    @xml_content_base64 = content_base64
end

#set_xml_tosign_from_path(xml_path) ⇒ Object

region set_xml_tosign



17
18
19
20
21
22
23
# File 'lib/rest_pki/xml_signature_starter.rb', line 17

def set_xml_tosign_from_path(xml_path)
    file = File.open(xml_path, 'rb')
    @xml_content_base64 = Base64.encode64(file.read)
    file.close

    @xml_content_base64
end

#set_xml_tosign_from_raw(content_raw) ⇒ Object



25
26
27
# File 'lib/rest_pki/xml_signature_starter.rb', line 25

def set_xml_tosign_from_raw(content_raw)
    @xml_content_base64 = Base64.encode64(content_raw)
end