T
Tomppa
Can I do this in CF with some other namespace?
static bool VerifyXmlDocument(RSA key, XmlDocument doc)
{
SignedXml sxml = new SignedXml(doc);
try
{
// Find signature node
XmlNode sig = doc.GetElementsByTagName("Signature",
SignedXml.XmlDsigNamespaceUrl)[0];
sxml.LoadXml((XmlElement)sig);
}
catch
{
// Not signed!
return false;
}
return sxml.CheckSignature(key);
}
static bool VerifyXmlDocument(RSA key, XmlDocument doc)
{
SignedXml sxml = new SignedXml(doc);
try
{
// Find signature node
XmlNode sig = doc.GetElementsByTagName("Signature",
SignedXml.XmlDsigNamespaceUrl)[0];
sxml.LoadXml((XmlElement)sig);
}
catch
{
// Not signed!
return false;
}
return sxml.CheckSignature(key);
}