Chad, thanks for your answer. Sorry for my funny english, but the question was for me more related to OpenSAML, and not to  <div>wsse4j. </div><div><br></div><div>The two assertions are semantically the same, so I can&#39;t understand why the signature fails. <br>
<div><br></div><div><br><br><div class="gmail_quote">On Fri, Aug 3, 2012 at 12:32 PM, Chad La Joie <span dir="ltr">&lt;<a href="mailto:lajoie@itumi.biz" target="_blank">lajoie@itumi.biz</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
OpenSAML questions need to be sent to the dev list.  WSSE4J question,<br>
which this is, needs to be sent to their mailing list.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, Aug 3, 2012 at 6:29 AM, <a href="mailto:massimiliano.masi@gmail.com">massimiliano.masi@gmail.com</a><br>
&lt;<a href="mailto:massimiliano.masi@gmail.com">massimiliano.masi@gmail.com</a>&gt; wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; Using OpenSAML I correctly validate the signature of an assertion that has<br>
&gt; as Subject Confirmation Data the following<br>
&gt;<br>
&gt;  &lt;wsse:SecurityTokenReference<br>
&gt;<br>
&gt; xmlns:wsse=&quot;<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" target="_blank">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</a>&quot;&gt;<br>

&gt;             &lt;wsse:KeyIdentifier<br>
&gt;<br>
&gt; ValueType=&quot;<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier" target="_blank">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier</a>&quot;&gt;<br>

&gt;                 Ytig1daWMVvZKbESb1W10TpDcJY=<br>
&gt;             &lt;/wsse:KeyIdentifier&gt;<br>
&gt;<br>
&gt;         &lt;/wsse:SecurityTokenReference&gt;<br>
&gt;<br>
&gt;<br>
&gt; When I add this assertion (using wsse4j) to the security header, DOM is<br>
&gt; pushing the namespace in the security header element, as:<br>
&gt;<br>
&gt; &lt;wsse:Security<br>
&gt; xmlns:wsse=&quot;<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" target="_blank">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd</a>&quot;&gt;<br>

&gt;             &lt;saml2:Assertion<br>
&gt;<br>
&gt;<br>
&gt; causing the keyInfo of the Subject Confirmation Data to be:<br>
&gt;<br>
&gt;<br>
&gt; &lt;wsse:SecurityTokenReference&gt;&lt;wsse:KeyIdentifier<br>
&gt; ValueType=&quot;<a href="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier" target="_blank">http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier</a>&quot;&gt;Ytig1daWMVvZKbESb1W10TpDcJY=&lt;/wsse:KeyIdentifier&gt;&lt;/wsse:SecurityTokenReference&gt;<br>

&gt;<br>
&gt;<br>
&gt; and this seems to break the validation of the saml assertion:<br>
&gt;<br>
&gt;<br>
&gt; Caused by: org.opensaml.xml.validation.ValidationException: Signature did<br>
&gt; not validate against the credential&#39;s key<br>
&gt;<br>
&gt; at<br>
&gt; org.opensaml.xml.signature.SignatureValidator.validate(SignatureValidator.java:78)<br>
&gt;<br>
&gt;<br>
&gt; How to avoid this situation? The assertion&#39;s SignedInfo is:<br>
&gt;<br>
&gt;<br>
&gt;           &lt;ds:SignedInfo&gt;<br>
&gt;<br>
&gt;             &lt;ds:CanonicalizationMethod<br>
&gt; Algorithm=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#" target="_blank">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot;/&gt;<br>
&gt;<br>
&gt;             &lt;ds:SignatureMethod<br>
&gt; Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a>&quot;/&gt;<br>
&gt;<br>
&gt;             &lt;ds:Reference URI=&quot;#uuid-d8840a0d-fa90-4522-806e-edc8dc427d2b&quot;&gt;<br>
&gt;<br>
&gt;               &lt;ds:Transforms&gt;<br>
&gt;<br>
&gt;                 &lt;ds:Transform<br>
&gt; Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature" target="_blank">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a>&quot;/&gt;<br>
&gt;<br>
&gt;                 &lt;ds:Transform<br>
&gt; Algorithm=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#" target="_blank">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot;/&gt;<br>
&gt;<br>
&gt;               &lt;/ds:Transforms&gt;<br>
&gt;<br>
&gt;               &lt;ds:DigestMethod<br>
&gt; Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#sha1" target="_blank">http://www.w3.org/2000/09/xmldsig#sha1</a>&quot;/&gt;<br>
&gt;<br>
&gt;               &lt;ds:DigestValue&gt;ghAD3gMLcZvyXFhVXJwNkeHCGi8=&lt;/ds:DigestValue&gt;<br>
&gt;<br>
&gt;             &lt;/ds:Reference&gt;<br>
&gt;<br>
&gt;           &lt;/ds:SignedInfo&gt;<br>
&gt;<br>
&gt;<br>
&gt; AFAIK, the two xmls are semantically equivalent, thus the signature shall<br>
&gt; behave the same, or am I wrong?<br>
&gt;<br>
&gt;<br>
&gt; Thanks a lot,<br>
&gt;<br>
&gt;<br>
&gt;      Massi<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Massimiliano Masi<br>
&gt;<br>
&gt; <a href="http://www.mascanc.net/~max" target="_blank">http://www.mascanc.net/~max</a><br>
&gt;<br>
</div></div><span class="HOEnZb"><font color="#888888">&gt; --<br>
&gt; To unsubscribe from this list send an email to<br>
&gt; <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.net</a><br>
<br>
<br>
<br>
--<br>
Chad La Joie<br>
<a href="http://www.itumi.biz" target="_blank">www.itumi.biz</a><br>
trusted identities, delivered<br>
--<br>
To unsubscribe from this list send an email to <a href="mailto:users-unsubscribe@shibboleth.net">users-unsubscribe@shibboleth.net</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Massimiliano Masi<br><br><a href="http://www.mascanc.net/~max">http://www.mascanc.net/~max</a><br>
</div></div>