Skip to content

Instantly share code, notes, and snippets.

@chadmyers
Created August 13, 2012 14:38
Show Gist options
  • Save chadmyers/3341309 to your computer and use it in GitHub Desktop.
Save chadmyers/3341309 to your computer and use it in GitHub Desktop.
SAML sample code
var signedXml = new SignedXml(_rawXml);
var publicKey = cert.PublicKey.Key;
var signatureElement = (XmlElement) _rawXml
.GetElementsByTagName("Signature","http://www.w3.org/2000/09/xmldsig#")
.First();
signedXml.LoadXml(signatureElement);
// I've tried it both ways (using the embedded key)
return signedXml.CheckSignature();
// I've tried it both ways (or providing the key)
return signedXml.CheckSignature(publicKey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment