I am a little new to cryptography so this could be something really stupid. I am struggling with getting this encryption decryption to work right. I am using this http://www.chaosink.co.uk/files/code/encryptionutils.zip class provided by Wolfwyrd (Thanks!) and following instructions in http://stackoverflow.com/questions/359342/an-effective-method-for-encrypting-a-license-file.
Below is the code in a nut shell
RSACryptoServiceProvider rsaKey = EncryptionUtils.GetRSAFromSnkFile(@"c\:a.snk");
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.PreserveWhitespace = true;
xmlDoc.LoadXml("<foo />");
SignXml(xmlDoc, rsaKey); //http://msdn.microsoft.com/en-us/library/ms229745.aspx
bool result = VerifyXml(xmlDoc, rsaKey); //http://msdn.microsoft.com/en-us/library/ms229950.aspx
System.Diagnostics.Debug.Write(result); //false
returns false. Note I used the same snk file, and its the same encrypted xml document I am trying to verify, why is it returning false. What am I missing?
Thanks in advance for your help.