2004-05-31 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / System.Security / System.Security.Cryptography.Xml / EncryptedType.cs
1 //
2 // EncryptedType.cs - EncryptedType implementation for XML Encryption
3 // http://www.w3.org/2001/04/xmlenc#sec-EncryptedType
4 //
5 // Author:
6 //      Tim Coleman (tim@timcoleman.com)
7 //
8 // Copyright (C) Tim Coleman, 2004
9
10 #if NET_2_0
11
12 using System.Xml;
13
14 namespace System.Security.Cryptography.Xml {
15         public abstract class EncryptedType {
16
17                 #region Fields
18
19                 CipherData cipherData;
20                 string encoding;
21                 EncryptionMethod encryptionMethod;
22                 EncryptionProperties encryptionProperties;
23                 string id;
24                 KeyInfo keyInfo;
25                 string mimeType;
26                 string type;
27         
28                 #endregion // Fields
29         
30                 #region Constructors
31
32                 protected EncryptedType ()
33                 {
34                         cipherData = null;
35                         encoding = null;
36                         encryptionMethod = null;
37                         encryptionProperties = new EncryptionProperties ();
38                         id = null;
39                         keyInfo = null;
40                         mimeType = null;
41                         type = null;
42                 }
43         
44                 #endregion // Constructors
45         
46                 #region Properties
47
48                 public virtual CipherData CipherData {
49                         get { return cipherData; }
50                         set { cipherData = value; }
51                 }
52
53                 public virtual string Encoding {
54                         get { return encoding; }
55                         set { encoding = value; }
56                 }
57
58                 public virtual EncryptionMethod EncryptionMethod {
59                         get { return encryptionMethod; }
60                         set { encryptionMethod = value; }
61                 }
62
63                 public virtual EncryptionProperties EncryptionProperties {
64                         get { return encryptionProperties; }
65                         set { encryptionProperties = value; }
66                 }
67
68                 public virtual string Id {
69                         get { return id; }
70                         set { id = value; }
71                 }
72
73                 public KeyInfo KeyInfo {
74                         get { return keyInfo; }
75                         set { keyInfo = value; }
76                 }
77
78                 public virtual string MimeType {
79                         get { return mimeType; }
80                         set { mimeType = value; }
81                 }
82
83                 public virtual string Type {
84                         get { return type; }
85                         set { type = value; }
86                 }
87
88                 #endregion // Properties
89
90                 #region Methods
91
92                 public void AddProperty (EncryptionProperty ep)
93                 {
94                         EncryptionProperties.Add (ep);
95                 }
96
97                 public abstract XmlElement GetXml ();
98                 public abstract void LoadXml (XmlElement value);
99
100                 #endregion // Methods
101         }
102 }
103
104 #endif