Merge pull request #2024 from BogdanovKirill/webrequesttest
[mono.git] / mcs / class / System.Security / System.Security.Cryptography.Xml / EncryptedKey.cs
index 3250d3f049635868decc089a33b8c904ac7fc072..ae22a95553b4afa194537d2dc3ae25e23bfe3c9b 100644 (file)
@@ -28,7 +28,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 
 using System.Xml;
 
@@ -46,11 +45,8 @@ namespace System.Security.Cryptography.Xml {
                #region Constructors
 
                public EncryptedKey ()
-                       : base ()
                {
-                       CarriedKeyName = null;
-                       Recipient = null;
-                       ReferenceList = new ReferenceList ();
+                       referenceList = new ReferenceList ();
                }
 
                #endregion // Constructors
@@ -69,7 +65,6 @@ namespace System.Security.Cryptography.Xml {
 
                public ReferenceList ReferenceList {
                        get { return referenceList; }
-                       set { referenceList = value; }
                }
 
                #endregion // Properties
@@ -96,7 +91,7 @@ namespace System.Security.Cryptography.Xml {
                        if (CipherData == null)
                                throw new CryptographicException ("Cipher data is not specified.");
 
-                       XmlElement xel = document.CreateElement (XmlEncryption.ElementNames.EncryptedData, EncryptedXml.XmlEncNamespaceUrl);
+                       XmlElement xel = document.CreateElement (XmlEncryption.ElementNames.EncryptedKey, EncryptedXml.XmlEncNamespaceUrl);
 
                        if (EncryptionMethod != null)
                                xel.AppendChild (EncryptionMethod.GetXml (document));
@@ -147,11 +142,9 @@ namespace System.Security.Cryptography.Xml {
                                throw new CryptographicException ("Malformed EncryptedKey element.");
                        else {
                                EncryptionMethod = null;
-                               KeyInfo keyInfo = null;
-                               CipherData cipherData = null;
                                EncryptionMethod = null;
-                               EncryptionProperties = new EncryptionProperties ();
-                               ReferenceList = new ReferenceList ();
+                               EncryptionProperties.Clear ();
+                               ReferenceList.Clear ();
                                CarriedKeyName = null;
                                Id = null;
                                Type = null;
@@ -222,4 +215,3 @@ namespace System.Security.Cryptography.Xml {
        }
 }
 
-#endif