Hello I have this XML as a SAML2 Response from my IDP:
<Assertion ID="_97031c65-0139-4047-a416-9495df5d6ed7"
IssueInstant="2016-10-26T07:45:43.438Z" Version="2.0"
xmlns="urn:oasis:names:tc:SAML:2.0:assertion">
<Issuer>
</Issuer>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod
Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<ds:Reference URI="#_97031c65-0139-4047-a416-9495df5d6ed7">
<ds:Transforms>
<ds:Transform
Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<ds:DigestValue>
KMaF...
</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
FHdZ....
</ds:SignatureValue>
<KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
<X509Data>
<X509Certificate>
MII....
</X509Certificate>
</X509Data>
</KeyInfo>
</ds:Signature>
....
Now i want to check if the Response is a valid response from my IDP. How can this be done? (I am using OpenSAML 3.x java) Is it enough just to do a string comparison on the signature and the cert?
I also have a MetadataDocument.XML with the credential info from my IDP (Azure).