XmlDsigC14NTransform.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // XmlDsigC14NTransform.cs - C14N Transform implementation for XML Signature
  3. // http://www.w3.org/TR/xml-c14n
  4. //
  5. // Author:
  6. // Sebastien Pouliot ([email protected])
  7. //
  8. // (C) 2002 Motus Technologies Inc. (http://www.motus.com)
  9. //
  10. using System.IO;
  11. using System.Xml;
  12. namespace System.Security.Cryptography.Xml {
  13. public class XmlDsigC14NTransform : Transform {
  14. protected bool comments;
  15. public XmlDsigC14NTransform ()
  16. {
  17. comments = false;
  18. }
  19. public XmlDsigC14NTransform (bool includeComments)
  20. {
  21. comments = includeComments;
  22. }
  23. public override Type[] InputTypes {
  24. get {
  25. if (input == null) {
  26. lock (this) {
  27. // this way the result is cached if called multiple time
  28. input = new Type [3];
  29. input[0] = typeof (System.IO.Stream);
  30. input[1] = typeof (System.Xml.XmlDocument);
  31. input[2] = typeof (System.Xml.XmlNodeList);
  32. }
  33. }
  34. return input;
  35. }
  36. }
  37. public override Type[] OutputTypes {
  38. get {
  39. if (output == null) {
  40. lock (this) {
  41. // this way the result is cached if called multiple time
  42. output = new Type [1];
  43. output[0] = typeof (System.IO.Stream);
  44. }
  45. }
  46. return output;
  47. }
  48. }
  49. protected override XmlNodeList GetInnerXml ()
  50. {
  51. return null; // THIS IS DOCUMENTED AS SUCH
  52. }
  53. public override object GetOutput ()
  54. {
  55. // return (object) new Stream ();
  56. return null;
  57. }
  58. public override object GetOutput (Type type)
  59. {
  60. if (type == Type.GetType ("Stream"))
  61. return GetOutput ();
  62. throw new ArgumentException ("type");
  63. }
  64. public override void LoadInnerXml (XmlNodeList nodeList)
  65. {
  66. // NO CHANGE
  67. }
  68. public override void LoadInput (object obj)
  69. {
  70. // if (type.Equals (Stream.GetType ())
  71. }
  72. }
  73. }