Created
August 13, 2012 14:38
-
-
Save chadmyers/3341309 to your computer and use it in GitHub Desktop.
SAML sample code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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