private XmlCanonicalizer canonicalizer;
private Stream s;
- public XmlDsigC14NTransform ()
+ public XmlDsigC14NTransform () : this (false)
{
- Algorithm = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
- canonicalizer = new XmlCanonicalizer (false, false, PropagatedNamespaces);
}
public XmlDsigC14NTransform (bool includeComments)
{
+ if (includeComments)
+ Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigC14NWithCommentsTransform;
+ else
+ Algorithm = XmlSignature.AlgorithmNamespaces.XmlDsigC14NTransform;
canonicalizer = new XmlCanonicalizer (includeComments, false, PropagatedNamespaces);
}
return null; // THIS IS DOCUMENTED AS SUCH
}
-#if NET_2_0
[ComVisible (false)]
public override byte[] GetDigestedOutput (HashAlgorithm hash)
{
+ // no null check, MS throws a NullReferenceException here
return hash.ComputeHash ((Stream) GetOutput ());
}
-#endif
public override object GetOutput ()
{
if (stream != null) {
XmlDocument doc = new XmlDocument ();
doc.PreserveWhitespace = true; // REALLY IMPORTANT
-#if NET_1_1
doc.XmlResolver = GetResolver ();
-#endif
doc.Load (new XmlSignatureStreamReader (new StreamReader (stream)));
// doc.Load ((Stream) obj);
s = canonicalizer.Canonicalize (doc);
if (nl != null) {
s = canonicalizer.Canonicalize (nl);
}
-#if NET_2_0
else
throw new ArgumentException ("obj");
-#else
- // note: there is no default are other types won't throw an exception
-#endif
}
}
}