Transform.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // Transform.cs - Transform implementation for XML Signature
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. using System.Runtime.InteropServices;
  10. using System.Xml;
  11. namespace System.Security.Cryptography.Xml {
  12. public abstract class Transform {
  13. private string algo;
  14. public Transform () {}
  15. public string Algorithm {
  16. get { return algo; }
  17. set { algo = value; }
  18. }
  19. public abstract Type[] InputTypes {
  20. get;
  21. }
  22. public abstract Type[] OutputTypes {
  23. get;
  24. }
  25. protected abstract XmlNodeList GetInnerXml ();
  26. public abstract object GetOutput ();
  27. public abstract object GetOutput (Type type);
  28. public XmlElement GetXml ()
  29. {
  30. XmlDocument document = new XmlDocument ();
  31. XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Transform, XmlSignature.NamespaceURI);
  32. xel.SetAttribute (XmlSignature.AttributeNames.Algorithm, algo);
  33. return xel;
  34. }
  35. public abstract void LoadInnerXml (XmlNodeList nodeList);
  36. public abstract void LoadInput (object obj);
  37. #if ! NET_1_0
  38. private XmlResolver xmlResolver;
  39. [MonoTODO("property not (yet) used in derived classes")]
  40. [ComVisible(false)]
  41. public XmlResolver Resolver {
  42. set { xmlResolver = value; }
  43. }
  44. #endif
  45. }
  46. }