Apply transform to a xml file.
/// <summary>
/// Applies the transform to the xml document.
/// </summary>
/// <param name="doc">The doc.</param>
/// <returns></returns>
private static Stream ApplyTransform(XmlDocument doc)
{
XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform();
env.LoadInput(doc.Clone());
object output1 = env.GetOutput();
Transform c14n = new XmlDsigExcC14NTransform();//(Transform)CryptoConfig.CreateFromName("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
c14n.LoadInput(output1);
Stream endObject = (Stream)c14n.GetOutput();
return endObject;
}
/// Applies the transform to the xml document.
/// </summary>
/// <param name="doc">The doc.</param>
/// <returns></returns>
private static Stream ApplyTransform(XmlDocument doc)
{
XmlDsigEnvelopedSignatureTransform env = new XmlDsigEnvelopedSignatureTransform();
env.LoadInput(doc.Clone());
object output1 = env.GetOutput();
Transform c14n = new XmlDsigExcC14NTransform();//(Transform)CryptoConfig.CreateFromName("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
c14n.LoadInput(output1);
Stream endObject = (Stream)c14n.GetOutput();
return endObject;
}