Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Core / System / Security / Cryptography / ECDiffieHellmanPublicKey.cs
index 91e89d8be9c4bebd3d8454aca3f17be88efe8ba1..62b83951fd7a2af3ecee06df1dd77e5935081956 100644 (file)
@@ -17,6 +17,10 @@ namespace System.Security.Cryptography {
     public abstract class ECDiffieHellmanPublicKey : IDisposable {
         private byte[] m_keyBlob;
 
+        protected ECDiffieHellmanPublicKey() {
+            m_keyBlob = new byte[0];
+        }
+
         protected ECDiffieHellmanPublicKey(byte[] keyBlob) {
             Contract.Ensures(m_keyBlob != null);
 
@@ -41,9 +45,26 @@ namespace System.Security.Cryptography {
         }
 
         // This method must be implemented by derived classes. In order to conform to the contract, it cannot be abstract.
-        public virtual string ToXmlString()
-        {
+        public virtual string ToXmlString() {
             throw new NotImplementedException(SR.GetString(SR.NotSupported_SubclassOverride));
         }
+
+        /// <summary>
+        /// When overridden in a derived class, exports the named or explicit ECParameters for an ECCurve.
+        /// If the curve has a name, the Curve property will contain named curve parameters, otherwise it
+        /// will contain explicit parameters.
+        /// </summary>
+        /// <returns>The ECParameters representing the point on the curve for this key.</returns>
+        public virtual ECParameters ExportParameters() {
+            throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+        }
+
+        /// <summary>
+        /// When overridden in a derived class, exports the explicit ECParameters for an ECCurve.
+        /// </summary>
+        /// <returns>The ECParameters representing the point on the curve for this key, using the explicit curve format.</returns>
+        public virtual ECParameters ExportExplicitParameters() {
+            throw new NotSupportedException(SR.GetString(SR.NotSupported_SubclassOverride));
+        }
     }
 }