KeyInfoEncryptedKey.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // KeyInfoEncryptedKey.cs - KeyInfoEncryptedKey implementation for XML Encryption
  3. // http://www.w3.org/2001/04/xmlenc#sec-EncryptedKey
  4. //
  5. // Author:
  6. // Tim Coleman ([email protected])
  7. //
  8. // Copyright (C) Tim Coleman, 2004
  9. //
  10. #if NET_1_2
  11. using System.Xml;
  12. namespace System.Security.Cryptography.Xml {
  13. public class KeyInfoEncryptedKey : KeyInfoClause {
  14. #region Fields
  15. EncryptedKey encryptedKey;
  16. #endregion // Fields
  17. #region Constructors
  18. public KeyInfoEncryptedKey ()
  19. {
  20. }
  21. public KeyInfoEncryptedKey (EncryptedKey ek)
  22. {
  23. EncryptedKey = ek;
  24. }
  25. #endregion // Constructors
  26. #region Properties
  27. public EncryptedKey EncryptedKey {
  28. get { return encryptedKey; }
  29. set { encryptedKey = value; }
  30. }
  31. #endregion // Properties
  32. #region Methods
  33. public override XmlElement GetXml ()
  34. {
  35. return GetXml (new XmlDocument ());
  36. }
  37. [MonoTODO]
  38. internal XmlElement GetXml (XmlDocument document)
  39. {
  40. if (encryptedKey != null)
  41. return encryptedKey.GetXml (document);
  42. return null;
  43. }
  44. [MonoTODO]
  45. public override void LoadXml (XmlElement value)
  46. {
  47. EncryptedKey = new EncryptedKey ();
  48. EncryptedKey.LoadXml (value);
  49. }
  50. #endregion // Methods
  51. }
  52. }
  53. #endif