Transform.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // Transform.cs - Transform implementation for XML Signature
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2002 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. using System.Text;
  10. using System.Xml;
  11. namespace System.Security.Cryptography.Xml {
  12. public abstract class Transform {
  13. protected string algo;
  14. protected Type[] input;
  15. protected Type[] output;
  16. public Transform () {}
  17. public string Algorithm {
  18. get { return algo; }
  19. set { algo = value; }
  20. }
  21. public abstract Type[] InputTypes {
  22. get;
  23. }
  24. public abstract Type[] OutputTypes {
  25. get;
  26. }
  27. protected abstract XmlNodeList GetInnerXml ();
  28. public abstract object GetOutput ();
  29. public abstract object GetOutput (Type type);
  30. public XmlElement GetXml ()
  31. {
  32. StringBuilder sb = new StringBuilder ();
  33. sb.Append ("<Transform Algorithm=\"");
  34. sb.Append (algo);
  35. sb.Append ("\"/>");
  36. XmlDocument doc = new XmlDocument ();
  37. doc.LoadXml (sb.ToString ());
  38. return doc.DocumentElement;
  39. }
  40. public abstract void LoadInnerXml (XmlNodeList nodeList);
  41. public abstract void LoadInput (object obj);
  42. }
  43. }