<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Canonicalized XML ouput in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707289#M32489</link>
    <description>&lt;P&gt;OK, I see... Well, I'm doing similar things, I guess. My problem, that this string I'm putting through CL_ABAP_MESSAGE_DIGEST has to be in a certain format (C14n, to be specific) and for this I seem not to have built-in SAP tool to perform such conversion. So, what I'm forced to do is, having a canonicalized version before my eyes, play with XML nodes, while combining the string, in order to get the desired result.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2018 14:19:25 GMT</pubDate>
    <dc:creator>iklovski</dc:creator>
    <dc:date>2018-11-28T14:19:25Z</dc:date>
    <item>
      <title>Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707285#M32485</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I'm composing an XML message to be sent through SWIFT services. As part of a message, I have to calculate a digest, based on SHA256 algorithm. The condition to calculate this digest correctly, is to apply the calculation method on 'canonicalized' XML output. &lt;/P&gt;
  &lt;P&gt;For example, if XML has an empty tag, e.g. &amp;lt;SWIFTNetNetworkInfo/&amp;gt;, canonicalized version of it would be: &lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;&amp;lt;SWIFTNetNetworkInfo&amp;gt;&amp;lt;/SWIFTNetNetworkInfo&amp;gt;.&lt;/EM&gt;&lt;/P&gt;
  &lt;P&gt;Do you have an idea/experience how to handle it properly? Is there some method in ABAP which would allow me to canonicalize my XML?&lt;/P&gt;
  &lt;P&gt;Currently, I'm constructing the XML using CALL TRANSFORMATION /RESULT XML functionality. Then, I have no choice, but to play with the strings in order to have my digest calculated correctly.&lt;/P&gt;
  &lt;P&gt;Thanks in advance,&lt;/P&gt;
  &lt;P&gt;Eli&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 10:52:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707285#M32485</guid>
      <dc:creator>iklovski</dc:creator>
      <dc:date>2018-11-28T10:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707286#M32486</link>
      <description>&lt;P&gt;Hi Eli.&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;P&gt;No, seriously, there are some packages/algorythms doing that.&lt;/P&gt;&lt;P&gt;I faced the same issue when i developed the Electronic Invoice for Hungary where the body was hashed via SHA256.&lt;/P&gt;&lt;P&gt;What i did was: read the xml node, hash them, update the node, but not via Transformation.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I changed my job, but if i can retrieve the code, i'll be happy to share with you!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 11:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707286#M32486</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2018-11-28T11:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707287#M32487</link>
      <description>&lt;P&gt;Ciao Simone,&lt;/P&gt;&lt;P&gt;Yes, that's what I'm forced to do: touching my right ear by my right arm around my head &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I just hoped that ABAP transformation could be not that smart, and that it could keep 'canonicalized' format, when I need it to.&lt;/P&gt;&lt;P&gt;Still, if it's not a big burden for you to retrieve your code, I'd be delighted to have it.&lt;/P&gt;&lt;P&gt;Eli&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 12:00:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707287#M32487</guid>
      <dc:creator>iklovski</dc:creator>
      <dc:date>2018-11-28T12:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707288#M32488</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;eli.klovski&lt;/SPAN&gt; i should check my hd at home (or bother former collegue), but i used this wiki to &lt;EM&gt;play &lt;/EM&gt;with XML&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.scn.sap.com/wiki/display/ABAP/Parse+an+xml+file+and+insert+values+in+ABAP" target="test_blank"&gt;https://wiki.scn.sap.com/wiki/display/ABAP/Parse+an+xml+file+and+insert+values+in+ABAP&lt;/A&gt; &lt;/P&gt;&lt;P&gt;and then, once i read the node into a string, i used CL_ABAP_MESSAGE_DIGEST (method CALCULATE_HASH_FOR_CHAR) to calculate the SHA256 value.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 12:37:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707288#M32488</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2018-11-28T12:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707289#M32489</link>
      <description>&lt;P&gt;OK, I see... Well, I'm doing similar things, I guess. My problem, that this string I'm putting through CL_ABAP_MESSAGE_DIGEST has to be in a certain format (C14n, to be specific) and for this I seem not to have built-in SAP tool to perform such conversion. So, what I'm forced to do is, having a canonicalized version before my eyes, play with XML nodes, while combining the string, in order to get the desired result.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:19:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707289#M32489</guid>
      <dc:creator>iklovski</dc:creator>
      <dc:date>2018-11-28T14:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707290#M32490</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;eli.klovski&lt;/SPAN&gt; C14N is... a string? a what? If it's a string, it's not a problem, that class takes the string, calculate the control character and turn it out.&lt;/P&gt;&lt;P&gt;I guess your problem is "take a readable string and convert to C14N format?" I had the same issue (AES-128) and had to rely on a GitHub project (quite cool), but for C14n you have standard CL_SEC_SXML_XENCRYPTION&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:35:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707290#M32490</guid>
      <dc:creator>SimoneMilesi</dc:creator>
      <dc:date>2018-11-28T14:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Canonicalized XML ouput</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707291#M32491</link>
      <description>&lt;P&gt;Finally, managed to do it with some string doing and fancy tricks. But, still, if there is some more inteligent way to deal with it, it would be intersting to know it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2018 08:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/canonicalized-xml-ouput/m-p/707291#M32491</guid>
      <dc:creator>iklovski</dc:creator>
      <dc:date>2018-11-29T08:56:20Z</dc:date>
    </item>
  </channel>
</rss>

