XmlDsigEnvelopedSignatureTransform.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // XmlDsigEnvelopedSignatureTransform.cs -
  3. // Enveloped Signature Transform implementation for XML Signature
  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 XmlDsigEnvelopedSignatureTransform : Transform {
  14. protected bool comments;
  15. public XmlDsigEnvelopedSignatureTransform ()
  16. {
  17. comments = false;
  18. }
  19. public XmlDsigEnvelopedSignatureTransform (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 [2];
  43. input[0] = typeof (System.Xml.XmlDocument);
  44. input[1] = typeof (System.Xml.XmlNodeList);
  45. }
  46. }
  47. return output;
  48. }
  49. }
  50. protected override XmlNodeList GetInnerXml ()
  51. {
  52. return null; // THIS IS DOCUMENTED AS SUCH
  53. }
  54. public override object GetOutput()
  55. {
  56. // return (object) new XmlNodeList ();
  57. return null;
  58. }
  59. public override object GetOutput (Type type)
  60. {
  61. if (type == Type.GetType ("Stream"))
  62. return GetOutput ();
  63. throw new ArgumentException ("type");
  64. }
  65. public override void LoadInnerXml (XmlNodeList nodeList)
  66. {
  67. // NO CHANGE
  68. }
  69. public override void LoadInput (object obj)
  70. {
  71. // if (type.Equals (Stream.GetType ())
  72. }
  73. }
  74. }