lib/sepa/soap_builder.rb
# Calculates signature for the given node in the given document. Uses the signing private key
# given to SoapBuilder for the signing. The node is canonicalized exclusively before signature
# calculation.
#
# @param doc [Nokogiri::XML] Document that contains the node
# @param node [String] Name of the node to calculate signature from
# @return [String] the base64 encoded signature
# @todo refactor to use canonicalization from utilities
Calculates signature for the given node in the given document. Uses the signing private key
given to SoapBuilder for the signing. The node is canonicalized exclusively before signature
calculation.
Calculates signature for the given node in the given document . Uses the signing private key given to SoapBuilder for the signing . The node is canonicalized exclusively before signature calculation .
def calculate_signature(doc, node)
        sha1                   = OpenSSL::Digest::SHA1.new
        node                   = doc.at_css(node)
        canon_signed_info_node = canonicalize_exclusively(node)
        signature              = @signing_private_key.sign(sha1, canon_signed_info_node)
        encode(signature).gsub(/\s+/, "")
      end
def calculate_signature ( doc , node ) sha1 = OpenSSL :: Digest :: SHA1 . new node = doc . at_css ( node ) canon_signed_info_node = canonicalize_exclusively ( node ) signature = @signing_private_key . sign ( sha1 , canon_signed_info_node ) encode ( signature ) . gsub ( / \s + / , "" ) end
Calculates signature for the given node in the given document.
Calculates signature for the given node in the given document .
the base64 encoded signature
the base64 encoded signature
String
doc
Document that contains the node
Document that contains the node
node
Name of the node to calculate signature from
Name of the node to calculate signature from
todo
refactor to use canonicalization from utilities
refactor to use canonicalization from utilities