KeyInfoName.cs 969 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // KeyInfoName.cs - KeyInfoName 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.Xml;
  10. namespace System.Security.Cryptography.Xml {
  11. public class KeyInfoName : KeyInfoClause {
  12. private string name;
  13. public KeyInfoName() {}
  14. public string Value {
  15. get { return name; }
  16. set { name = value; }
  17. }
  18. public override XmlElement GetXml ()
  19. {
  20. XmlDocument document = new XmlDocument ();
  21. XmlElement xel = document.CreateElement (XmlSignature.ElementNames.KeyName, XmlSignature.NamespaceURI);
  22. xel.InnerText = name;
  23. return xel;
  24. }
  25. public override void LoadXml (XmlElement value)
  26. {
  27. if (value == null)
  28. throw new ArgumentNullException ();
  29. if ((value.LocalName != XmlSignature.ElementNames.KeyName) || (value.NamespaceURI != XmlSignature.NamespaceURI))
  30. name = "";
  31. else
  32. name = value.InnerText;
  33. }
  34. }
  35. }