<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am not sure if  this the right forum for the issue that I having, I have upgraded to  opensaml3 downloaded from shibboleth. My application is a service provider and I am trying to validate Saml Response from an IDP  that has a signed
 Assertion. <o:p></o:p></p>
<p class="MsoNormal">I have the IDP public x509 in my keystore, and that is the only certificate in that keystore. I could see that the embedded x509data in the assertion matches the public certificate of the IDP in my keystore and yet I am not able to verify
 the digital signature. Here is the logic that I am using<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">               
<span style="background:silver;mso-highlight:silver">BasicX509Credential</span> cred =
</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">
<span style="background:silver;mso-highlight:silver">BasicX509Credential</span>();</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                  cred.setEntityCertificate(matchedCert);</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                  cred.setPublicKey(matchedCert.getPublicKey());</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                  cred.setCRLs(</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">null</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">);
</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                 
</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">            </span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">try</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">
 {</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                SignatureValidator signatureValidator =
</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black"> SignatureValidator(cred);</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                signatureValidator.validate(sig);</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">               
</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">return</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">
</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">true</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black">;</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">              }
</span><b><span style="font-size:10.0pt;font-family:"Courier New";color:#7F0055">catch</span></b><span style="font-size:10.0pt;font-family:"Courier New";color:black"> (ValidationException ex) {</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                    ex.printStackTrace();</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">                System.</span><i><span style="font-size:10.0pt;font-family:"Courier New";color:#0000C0">out</span></i><span style="font-size:10.0pt;font-family:"Courier New";color:black">.println(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#2A00FF">"********
 signature validation failed"</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">);</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">              }</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:black">           
</span><span style="font-size:10.0pt;font-family:"Courier New""><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">But I keep getting the following stacktrace …<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,857 [Service-0] DEBUG systemout - org.opensaml.xml.validation.ValidationException: Signature did not validate against the credential's key<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at org.opensaml.xml.signature.SignatureValidator.validate(SignatureValidator.java:78)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.verifySAMLSignature(SimpleSamlTokenManager.java:482)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.validateAssertionSignature(SimpleSamlTokenManager.java:370)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.validateSignature(SimpleSamlTokenManager.java:333)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.verifySamlAuthenticationResponse(SimpleSamlTokenManager.java:300)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.sso.impl.SingleSignonServiceImpl.samlTokenVerify(SingleSignonServiceImpl.java:749)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.sso.impl.SingleSignonServiceImpl$RequestListener$8.run(SingleSignonServiceImpl.java:1790)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,860 [Service-0] DEBUG systemout -               at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)<o:p></o:p></p>
<p class="MsoNormal">2019-01-03 21:21:03,860 [Service-0] DEBUG systemout -               at java.lang.Thread.run(Thread.java:811)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I would appreciate it if anyone could point me to the right solution or maybe point out what my code is doing wrong. I have tried to run sample codes around this issue, but I have still to get any of the signature validation to be successful.
 Any help or suggestions would be greatly appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
=====================================================<br>
<font face="Arial" color="Black" size="2">Please refer to http://www.aricent.com/email-disclaimer<br>
for important disclosures regarding this electronic communication.<br>
</font>=====================================================<br>
</body>
</html>