Hi Nat,<br><br>yes you&#39;re right most of those impls are wrappers over aleksey&#39;s xmlsec library. <br>Using wrappers requires systems running those services to have xmlsec lib installed. <br>
<br>Most unix like distros are shipped with this xmlsec and if not it could be downloaded from the aleksey site (<a href="http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.9.tar.gz">http://www.aleksey.com/xmlsec/download/xmlsec1-1.2.9.tar.gz</a>).<br>

<br>Processing on xmlsignature is not very complex, but transforms like c14n are.<br><br>So most complex processes are to perform those transformation processes that are complicated to implement and very aggressive on computation requirements.<br>
<br>As I said yesterday this morning I made a comparative of some available options and what I&#39;ve liked most is <a href="http://xmlsig.sourceforge.net/">http://xmlsig.sourceforge.net/</a> <br><br>This lib provides a set of wrappers over xmlsec made available using swig. Those bindings that are suposed to work in php, python and ruby. I tested the ruby version.<br>
<br>Installation requires libxml, libsxlt, swig and libxmlsec including their -dev packages. I have to fix some include paths on building because make didn&#39;t find header files from those libs.<br> <br>I started the process from the scratch and took me less than 1 hour to have ruby code performing enveloped/enveloping signature creation and validation (only crypto validation no certificate validation process is included).<br>
<br>I submit the code I created to have a message signer/validator. The examples available on the test directory from the lib are awesome to know how to perform signing and verification primitives calls.<br><br>So my point of view about using pure dynamic libs or libs creating a bridge over C libs is depend. Pure dynamic libs are easier to deploy but in some cases like openssl, xml processing or in this case xml signature (core tasks) bridging could be a good alternative.<br>
<br>I post here my sample code on ruby. I got it working on Ubuntu running on amd64 and debian running on power g4 but the doc claims the lib working on most UNIX like systems including MacOSX and Windows.<br><br>Hope this helps :)<br>
<br>Best regards<br><br>Dave <br><br>require &#39;xmlsig&#39;<br>class MessageSigner<br><br>def self.sign_message(message , xpath = nil)<br>    x = Xmlsig::XmlDoc.new<br>    x.loadFromString(message)<br><br>    private_key = Xmlsig::Key.new<br>
    private_key.loadFromFile(&#39;rsakey.pem&#39;,&#39;pem&#39;,&#39;&#39;)<br><br>    signing_certificate = Xmlsig::Signer.new(x,private_key)<br>    signing_certificate.addCertFromFile(&#39;rsacert.pem&#39;, &#39;pem&#39;)<br>
        <br>    if (xpath.nil?)<br>        signed_signature = signing_certificate.sign<br>        return signed_signature.toString<br>    else<br>        xp = Xmlsig::XPath.new<br>            xp.setXPath(xpath)<br>        signing_certificate.signInPlace(xp)<br>
        return x.toString    <br>    end <br>end<br><br>def self.verify_message(signed_message)<br>    to_be_verified = Xmlsig::XmlDoc.new<br>    to_be_verified.loadFromString(signed_message)<br>    <br>    #Assuming a single signature per message    <br>
    xp = Xmlsig::XPath.new()<br>    xp.addNamespace(&#39;ds&#39;, &#39;<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>&#39;)<br>    xp.setXPath(&#39;/descendant::ds:Signature[position()=1]&#39;)<br>
    v = Xmlsig::Verifier.new(to_be_verified,xp)<br>    valid = v.verify<br><br>    return valid == 1<br>end<br><br>message = &quot;&lt;Message&gt;message content &lt;/Message&gt;&quot;<br><br><br>#Second param is xpath. <br>
#If not provided signature will be enveloping, this is signed message will be embeded inside ds:Object node<br>#Providing Xpath will result in the signature being embeded inside the message to be signed, that is an enveloped signature<br>
signed_message = sign_message(message, &quot;/Message&quot;)<br><br><br>valid = verify_message(signed_message)<br><br>puts &quot;Signature #{valid ? &quot;is&quot; : &quot;isn&#39;t&quot;} valid!&quot;<br><br>#Trying to cheat the signature validator<br>
signed_message = signed_message.gsub(/content/, &quot;other content&quot;)<br>valid = verify_message(signed_message)<br><br>puts &quot;Signature #{valid ? &quot;is&quot; : &quot;isn&#39;t&quot;} valid!&quot;<br><br>end<br>
<br><div class="gmail_quote">2009/6/13 Nat Sakimura <span dir="ltr">&lt;<a href="mailto:sakimura@gmail.com">sakimura@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks David, <div><br></div><div>One of the issue that has been raised was that much of those scripting languages implementation actually calls C++ library to do the task. This makes it difficult to deploy it in some hosting and PaaS environment, so libs written in that scripting language is sought. </div>

<div><br></div><div>If it is not there, then we need to evaluate how easy is it to do that, and perhaps create a project to make them. </div><div><br></div><div>Cheers, </div><div><br></div><div><font color="#888888">=nat</font><div>
<div></div><div class="h5"><br><br><div class="gmail_quote">
On Sat, Jun 13, 2009 at 3:01 AM, David Garcia <span dir="ltr">&lt;<a href="mailto:davebcn@gmail.com" target="_blank">davebcn@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi,<br>
<br>
Sure I&#39;ll do it, but let me make an in-depth analisis of alternatives before pointing to a concrete implementation.<br>
<br>
I&#39;ll rebrowse sources to make those checks this weekend.<br>
<br>
Best regards<br>
<br>
David Garcia<br>
<br>
El 12/06/2009, a las 19:19, Tatsuki Sakushima &lt;<a href="mailto:tatsuki@nri.com" target="_blank">tatsuki@nri.com</a>&gt; escribió:<div><div></div><div><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi David,<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I completely agree with you, a single technology for those closely related protocols would be better than forking. The main advantage using XMLdSIG is that there are a huge amount of services currently working with this technology. As far as I know there are mature libs for C, C++, Java, .net, python, ruby, php .<br>


</blockquote>
<br>
Can you navigate us to some libraries you have seen especially for those scripting languages, python, ruby, and php? So some of us including me can test them and see how they works. Some forks expertizing XML says XML DSig with exclusive c14n is &quot;easy enough&quot;, but many of us haven&#39;t seen the real example in scripting languages. And if it is easy or not is somewhat subjective. I think showing examples will facilitate this discussion.<br>


<br>
Best,<br>
Tatsuki<br>
<br>
Tatsuki Sakushima<br>
NRI Pacific - Nomura Research Institute America, Inc.<br>
<br>
(6/12/09 1:48 AM), David Garcia wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Nat,<br>
I completely agree with you, a single technology for those closely related protocols would be better than forking. The main advantage using XMLdSIG is that there are a huge amount of services currently working with this technology. As far as I know there are mature libs for C, C++, Java, .net, python, ruby, php .<br>


Those libs are compliant with xmldsig interopt tests so this give us warranties about their intertoperability. Message sign and verify primitives are very simple from the point of view of the developer and the only problem arises when trying to verify the signer certificate (path building, validation, status validation vs CRL and OCSP...) but several &quot;tricks&quot; could be made here to keep the process simple.<br>


I&#39;ll feel very comfortable about using XMLdSIG because from the point of view of the increase of complexity it won&#39;t be as easy as raw data processing, but it won&#39;t be very painful if we use those sets of libs.<br>


If you want maybe we can create a little project for a proof of concept and make an interop between 2 different technologies signing and verifying messages. If so please let me know :).<br>
Best regards<br>
Dave<br>
2009/6/12 =nat &lt;<a href="mailto:sakimura@gmail.com" target="_blank">sakimura@gmail.com</a> &lt;mailto:<a href="mailto:sakimura@gmail.com" target="_blank">sakimura@gmail.com</a>&gt;&gt;<br>
   Hi.<br>
   Thanks for your great feedback.<br>
   It is kind of interesting that OpenID side wants the simplest form while<br>
   in the OAuth list, XML DSig is liked better somehow.<br>
    &gt;From the spec point of view, it is better to not to fork as much as<br>
   possible,<br>
   so if we can stick to XML DSig, that&#39;s great.<br>
   Now, here is another question then.<br>
   If libraries with decent API becomes available to each language,<br>
   written in that language, and is tested for compatibility to each other,<br>
   would you be amiable to this constrained form of XML DSig?<br>
   =nat<br>
   On Thu, 11 Jun 2009 16:14:56 +0200, David Garcia<br>
   &lt;<a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a> &lt;mailto:<a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a>&gt;&gt;<br>
   wrote:<br>
    &gt; Hi Hans,<br>
    &gt;<br>
    &gt; this project offers a set of wrappers over xmlsec library used on<br>
   many<br>
   c++<br>
    &gt; envs. I used it a lot and their equivalent in Java for some years on<br>
    &gt; critical production envs and they&#39;re very mature.<br>
    &gt;<br>
    &gt; Dealing with xml data as opaque bits (a simplified xml version of CMS<br>
    &gt; signature containers) instead of interpreting the infoset as proposed<br>
   will<br>
    &gt; be a much simpler approach because it eliminates the need of<br>
   using c14n<br>
    &gt; and<br>
    &gt; transform algorithms (not mandatory but recommended on some<br>
   scenarios).<br>
    &gt;<br>
    &gt; Maybe this simpler approach will fit for message exchange.<br>
    &gt;<br>
    &gt; Best regards<br>
    &gt;<br>
    &gt; Dave Garcia<br>
    &gt;<br>
    &gt;<br>
    &gt; 2009/6/11 Hans Granqvist &lt;<a href="mailto:hans@granqvist.com" target="_blank">hans@granqvist.com</a><br>
   &lt;mailto:<a href="mailto:hans@granqvist.com" target="_blank">hans@granqvist.com</a>&gt;&gt;<br>
    &gt;<br>
    &gt;&gt; Perhaps someone from VeriSign (Barry? Gary?) can comment on the<br>
    &gt; viability<br>
    &gt;&gt; of<br>
    &gt;&gt; <a href="http://xmlsig.sourceforge.net/" target="_blank">http://xmlsig.sourceforge.net/</a><br>
    &gt;&gt;<br>
    &gt;&gt; Hans<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt;<br>
    &gt;&gt; On Wed, Jun 10, 2009 at 11:54 PM, John Panzer&lt;<a href="mailto:jpanzer@acm.org" target="_blank">jpanzer@acm.org</a><br>
   &lt;mailto:<a href="mailto:jpanzer@acm.org" target="_blank">jpanzer@acm.org</a>&gt;&gt; wrote:<br>
    &gt;&gt; &gt; My general impression is that something that requires two<br>
   pieces of<br>
    &gt;&gt; software<br>
    &gt;&gt; &gt; to agree on an exact, bit for bit infoset representation of an XML<br>
    &gt;&gt; document<br>
    &gt;&gt; &gt; in order to get security to work is a poor idea.  I have seen<br>
   no wide<br>
    &gt;&gt; &gt; deployments/usage of DSig in Atom feeds -- despite it being<br>
   part of<br>
    &gt; the<br>
    &gt;&gt; spec<br>
    &gt;&gt; &gt; -- and many complaints about how it&#39;s not possible to get it<br>
   to work<br>
    &gt;&gt; &gt; reliably given the software stacks currently in use.  The<br>
   difficulties<br>
    &gt;&gt; with<br>
    &gt;&gt; &gt; canonicalization-for-signing in OAuth implementations have also<br>
    &gt;&gt; reinforced<br>
    &gt;&gt; &gt; my belief that it&#39;s much better to err on the side of the<br>
   robust and<br>
    &gt;&gt; simple.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Signing a stream of uninterpreted bytes cuts out a whole slew of<br>
    &gt; failure<br>
    &gt;&gt; &gt; modes, and the ones that remain are debuggable -- the bytes<br>
   match or<br>
    &gt; they<br>
    &gt;&gt; &gt; don&#39;t, and standard tools can tell you which.  It means it&#39;s<br>
   possible<br>
    &gt; to<br>
    &gt;&gt; &gt; verify a signature with curl + a command line utility.  These<br>
   are all<br>
    &gt;&gt; very<br>
    &gt;&gt; &gt; good things.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; (As a side note, it would also make the content type<br>
   orthogonal to the<br>
    &gt;&gt; &gt; signature code -- this is a good thing.)<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; So, +1 for the simplest form of signing that could possibly work.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; -John<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Johannes Ernst wrote:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; I proposed something I called XML-RSig for similar reasons a<br>
   few years<br>
    &gt;&gt; ago:<br>
    &gt;&gt; &gt;<br>
    &gt;&gt;<br>
   <a href="http://netmesh.info/jernst/Technical/really-simple-xml-signatures.html" target="_blank">http://netmesh.info/jernst/Technical/really-simple-xml-signatures.html</a><br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; &quot;RSig&quot; for &quot;Really simple Signature&quot;.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; The trouble for OpenID and XRD and so forth is that it is not<br>
   our core<br>
    &gt;&gt; &gt; competency -- and shouldn&#39;t be -- to innovate around things that<br>
    &gt; really<br>
    &gt;&gt; &gt; aren&#39;t our business. Signing XML documents isn&#39;t our business.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; On the other hand, the people whose business it should be<br>
   somehow seem<br>
    &gt; to<br>
    &gt;&gt; be<br>
    &gt;&gt; &gt; asleep at the wheel, as the problems are well-known and<br>
   somehow aren&#39;t<br>
    &gt;&gt; being<br>
    &gt;&gt; &gt; addressed, and haven&#39;t for years.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; It seems to me that the best way out of this conundrum is:<br>
    &gt;&gt; &gt; 1. to foresee, architecturally, the use of several different<br>
   ways of<br>
    &gt;&gt; &gt; constructing signatures, as the matter clearly isn&#39;t settled<br>
    &gt;&gt; &gt; 2. to make sure that high-end approaches (like XML-DSIG) work<br>
   well,<br>
    &gt; but<br>
    &gt;&gt; &gt; low-end approaches (like XML-RSIG) work just as well<br>
    &gt;&gt; &gt; 3. to maintain a best practices document that says &quot;today,<br>
   choice X is<br>
    &gt;&gt; your<br>
    &gt;&gt; &gt; best bet, and we say that because based on our market<br>
   research, X has<br>
    &gt; the<br>
    &gt;&gt; &gt; highest market share in terms of implementors today.&quot;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; As we all know, any problem in computer science can be solved by<br>
    &gt; adding a<br>
    &gt;&gt; &gt; level of indirection. This may well be one of those cases.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; Johannes Ernst<br>
    &gt;&gt; &gt; NetMesh Inc.<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; ________________________________<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; ________________________________<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;  <a href="http://netmesh.info/jernst" target="_blank">http://netmesh.info/jernst</a><br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; ________________________________<br>
    &gt;&gt; &gt; _______________________________________________<br>
    &gt;&gt; &gt; specs mailing list<br>
    &gt;&gt; &gt; <a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a> &lt;mailto:<a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a>&gt;<br>
    &gt;&gt; &gt; <a href="http://openid.net/mailman/listinfo/specs" target="_blank">http://openid.net/mailman/listinfo/specs</a><br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt; _______________________________________________<br>
    &gt;&gt; &gt; specs mailing list<br>
    &gt;&gt; &gt; <a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a> &lt;mailto:<a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a>&gt;<br>
    &gt;&gt; &gt; <a href="http://openid.net/mailman/listinfo/specs" target="_blank">http://openid.net/mailman/listinfo/specs</a><br>
    &gt;&gt; &gt;<br>
    &gt;&gt; &gt;<br>
    &gt;&gt; _______________________________________________<br>
    &gt;&gt; specs mailing list<br>
    &gt;&gt; <a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a> &lt;mailto:<a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a>&gt;<br>
    &gt;&gt; <a href="http://openid.net/mailman/listinfo/specs" target="_blank">http://openid.net/mailman/listinfo/specs</a><br>
    &gt;&gt;<br>
    &gt;<br>
    &gt;<br>
    &gt;<br>
    &gt; --<br>
    &gt; David Garcia<br>
    &gt; CTO<br>
    &gt;<br>
    &gt; Tractis - Online contracts you can enforce<br>
    &gt; <a href="http://www.tractis.com" target="_blank">http://www.tractis.com</a><br>
    &gt; --<br>
    &gt; Tel: (34) 93 551 96 60 (ext. 260)<br>
    &gt;<br>
    &gt; Email: <a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a> &lt;mailto:<a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a>&gt;<br>
    &gt; Blog: <a href="http://blog.negonation.com" target="_blank">http://blog.negonation.com</a><br>
    &gt; Twitter: <a href="http://twitter.com/tractis" target="_blank">http://twitter.com/tractis</a><br>
-- <br>
David Garcia<br>
CTO<br>
Tractis - Online contracts you can enforce<br>
<a href="http://www.tractis.com" target="_blank">http://www.tractis.com</a><br>
--<br>
Tel: (34) 93 551 96 60 (ext. 260)<br>
Email: <a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a> &lt;mailto:<a href="mailto:david.garcia@tractis.com" target="_blank">david.garcia@tractis.com</a>&gt;<br>
Blog: <a href="http://blog.negonation.com" target="_blank">http://blog.negonation.com</a><br>
Twitter: <a href="http://twitter.com/tractis" target="_blank">http://twitter.com/tractis</a><br>
------------------------------------------------------------------------<br>
_______________________________________________<br>
specs mailing list<br>
<a href="mailto:specs@openid.net" target="_blank">specs@openid.net</a><br>
<a href="http://openid.net/mailman/listinfo/specs" target="_blank">http://openid.net/mailman/listinfo/specs</a><br>
</blockquote></blockquote>
</div></div></blockquote></div><br><br clear="all"><br></div></div><div class="im">-- <br>Nat Sakimura (=nat)<br><a href="http://www.sakimura.org/en/" target="_blank">http://www.sakimura.org/en/</a><br>
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br>David Garcia<br>CTO<br><br>Tractis - Online contracts you can enforce<br><a href="http://www.tractis.com">http://www.tractis.com</a><br>--<br>Tel: (34) 93 551 96 60 (ext. 260) <br>
<br>Email: <a href="mailto:david.garcia@tractis.com">david.garcia@tractis.com</a><br>Blog: <a href="http://blog.negonation.com">http://blog.negonation.com</a><br>Twitter: <a href="http://twitter.com/tractis">http://twitter.com/tractis</a><br>