lib/signer.rb in eet_signer-1.5.0 vs lib/signer.rb in eet_signer-1.6.0

- old
+ new

@@ -83,10 +83,11 @@ def signature_node @signature_node ||= begin @signature_node = security_node.at_xpath('ds:Signature', ds: DS_NAMESPACE) unless @signature_node @signature_node = Nokogiri::XML::Node.new('Signature', document) + @signature_node['Id'] = "SIG-#{security_token_id.split('-').last}" set_namespace_for_node(@signature_node, DS_NAMESPACE, ds_namespace_prefix) security_node.add_child(@signature_node) end @signature_node end @@ -247,11 +248,11 @@ transform_node.add_child(inclusive_namespaces_node) end transforms_node.add_child(transform_node) digest_method_node = Nokogiri::XML::Node.new('DigestMethod', document) - digest_method_node['Algorithm'] = @digester.digest_id + digest_method_node['Algorithm'] = 'http://www.w3.org/2001/04/xmlenc#sha256' reference_node.add_child(digest_method_node) set_namespace_for_node(digest_method_node, DS_NAMESPACE, ds_namespace_prefix) digest_value_node = Nokogiri::XML::Node.new('DigestValue', document) digest_value_node.content = target_digest @@ -301,11 +302,11 @@ protected # Reset digest algorithm for signature creation and signature algorithm identifier def set_default_signature_method! - self.signature_digest_algorithm = :sha1 - self.signature_algorithm_id = 'http://www.w3.org/2000/09/xmldsig#rsa-sha1' + self.signature_digest_algorithm = :sha256 + self.signature_algorithm_id = 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' end ## # Searches in namespaces, defined on +target_node+ or its ancestors, # for the +namespace+ with given URI and returns its prefix.