<div dir="ltr"><div><div>LockBox 3 should do what you need, handling all sorts of cryptography:<br><br><a href="https://github.com/TurboPack/LockBox3">https://github.com/TurboPack/LockBox3</a><br><br></div>Highly recommend using a library, crypto isn&#39;t something you want to do yourself.<br><br></div>Robo<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 28, 2016 at 11:56 PM, David Moorhouse <span dir="ltr">&lt;<a href="mailto:David.Moorhouse@pegasus.org.nz" target="_blank">David.Moorhouse@pegasus.org.nz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-NZ">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Thx Vik<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I can do this in dot Net.  I’m looking for a Delphi implementation so we can fit it into some existing code.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">The Clever Components suite appears to have an implementation but don’t want to splash out for the $<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Cheers<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">D<u></u><u></u></span></p><span class="">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<table style="border-collapse:collapse" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="width:267.65pt;padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="357">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">David Moorhouse (BCom)</span></b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"> |
<b>Principal Software Engineer - HealthOne</b><br>
Pegasus Health (Charitable) Ltd </span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">P: 03 353 0871 |   W:  </span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><a href="http://www.pegasus.org.nz/" target="_blank"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">www.pegasus.org.nz</span></a></span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"> <br>
E: </span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><a href="mailto:david.moorhouse@pegasus.org.nz" target="_blank">david.moorhouse@pegasus.org.nz</a></span><u><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"><br>
</span></u><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">PO Box 741, Christchurch 8140<br>
160 Bealey Ave, Christchurch 8014</span><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#47678f"><u></u><u></u></span></b></p>
</td>
<td style="width:194.45pt;padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="259">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><img src="cid:image001.jpg@01D1E97F.6C62D5B0" alt="cid:image003.jpg@01CEE516.6F544D00" height="76" border="0" width="240"></span><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#47678f"><u></u><u></u></span></b></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US"> <a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a> [mailto:<a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a>]
<b>On Behalf Of </b>Vik Vasudev<br>
<b>Sent:</b> Friday, 29 July 2016 9:46 a.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> Re: [DUG] Signing XML<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi David,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">May be this might help (sorry its not a Delphi code its in C#)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="https://msdn.microsoft.com/en-us/library/ms229744(v=vs.110).aspx" target="_blank">https://msdn.microsoft.com/en-us/library/ms229744(v=vs.110).aspx</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Jul 29, 2016 at 8:53 AM, David Moorhouse &lt;<a href="mailto:David.Moorhouse@pegasus.org.nz" target="_blank">David.Moorhouse@pegasus.org.nz</a>&gt; wrote:<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hi<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">We have the need to sign a snippet of XML with an X509 digital  certificate.  The algorithm is to canonicalise  the XML, compute a SHA256 hash on this, and sign the hash with the
 certificate’s private key.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">I can’t see any easy way of doing this within the VCL.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Any hints, or better still working code, are appreciated.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">David<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<table style="border-collapse:collapse" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td style="width:267.65pt;padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="357">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">David Moorhouse (BCom)</span></b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">
 | <b>Principal Software Engineer - HealthOne</b><br>
Pegasus Health (Charitable) Ltd </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">P: 03 353 0871 |   W:  </span><span style="color:#1f497d"><a href="http://www.pegasus.org.nz/" target="_blank"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">www.pegasus.org.nz</span></a></span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"> <br>
E: </span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><a href="mailto:david.moorhouse@pegasus.org.nz" target="_blank">david.moorhouse@pegasus.org.nz</a></span><u><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f"><br>
</span></u><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">PO Box 741, Christchurch 8140<br>
160 Bealey Ave, Christchurch 8014</span><u></u><u></u></p>
</td>
<td style="width:194.45pt;padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="259">
<p class="MsoNormal"><span style="color:#1f497d"><img src="cid:image001.jpg@01D1E97F.6C62D5B0" alt="cid:image003.jpg@01CEE516.6F544D00" height="76" border="0" width="240"></span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">*****************************************************</span><u></u><u></u></p>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">This email or attachment(s) may contain confidential or legally privileged information intended for the sole use of the addressee(s). Any use, redistribution, disclosure, or reproduction
 of this message, except as intended, is prohibited. If you received this email in error, please notify the sender and erase all copies of the message, including any attachments.</span><u></u><u></u></p>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">Any views or opinions expressed in this email (unless otherwise stated) may not represent those of Pegasus Health Ltd.</span><u></u><u></u></p>
<p><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#47678f">**********************************************************</span><u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">
delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<u></u><u></u></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<p class="MsoNormal">  vikas<u></u><u></u></p>
</div>
</div>
</div></div></div><div><div class="h5">

<p><font face="Arial" color="#47678f" size="2">*****************************************************</font></p>
<p><font face="Arial" color="#47678f" size="2">This email or attachment(s) may contain 
confidential or legally privileged information intended for the sole use of the 
addressee(s). Any use, redistribution, disclosure, or reproduction of this 
message, except as intended, is prohibited. If you received this email in error, 
please notify the sender and erase all copies of the message, including any 
attachments.</font></p>
<p><font face="Arial" color="#47678f" size="2">Any views or opinions expressed in this 
email (unless otherwise stated) may not represent those of Pegasus Health 
Ltd.</font></p>
<p><font face="Arial" color="#47678f" size="2">**********************************************************</font></p>
</div></div></div>

<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" rel="noreferrer" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div>