2004-03-23 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Security / System.Security.Cryptography.Xml / KeyInfoEncryptedKey.cs
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 (tim@timcoleman.com)
7 //
8 // Copyright (C) Tim Coleman, 2004
9 //
10
11 #if NET_1_2
12
13 using System.Xml;
14
15 namespace System.Security.Cryptography.Xml {
16
17         public class KeyInfoEncryptedKey : KeyInfoClause {
18
19                 #region Fields
20
21                 EncryptedKey encryptedKey;
22
23                 #endregion // Fields
24
25                 #region Constructors
26
27                 public KeyInfoEncryptedKey ()
28                 {
29                 }
30
31                 public KeyInfoEncryptedKey (EncryptedKey ek)
32                 {
33                         EncryptedKey = ek;
34                 }
35
36                 #endregion // Constructors
37
38                 #region Properties
39
40                 public EncryptedKey EncryptedKey {
41                         get { return encryptedKey; }
42                         set { encryptedKey = value; }
43                 }
44
45                 #endregion // Properties
46
47                 #region Methods
48
49                 public override XmlElement GetXml ()
50                 {
51                         return GetXml (new XmlDocument ());
52                 }
53
54                 [MonoTODO]
55                 internal XmlElement GetXml (XmlDocument document)
56                 {
57                         if (encryptedKey != null)
58                                 return encryptedKey.GetXml (document);
59                         return null;
60                 }
61
62                 [MonoTODO]
63                 public override void LoadXml (XmlElement value)
64                 {
65                         EncryptedKey = new EncryptedKey ();
66                         EncryptedKey.LoadXml (value);
67                 }
68
69                 #endregion // Methods
70         }
71 }
72
73 #endif