CKey constructors
authorCryptoManiac <balthazar@yandex.ru>
Sun, 16 Aug 2015 20:04:14 +0000 (23:04 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Sun, 16 Aug 2015 20:04:14 +0000 (23:04 +0300)
Novacoin/CKey.cs

index 7dc7330..875ac7f 100644 (file)
@@ -6,13 +6,43 @@ using System.Threading.Tasks;
 
 namespace Novacoin
 {
+    /// <summary>
+    /// Representation of ECDSA private key
+    /// </summary>
     public class CKey
     {
+        /// <summary>
+        /// Private key bytes
+        /// </summary>
+        private List<byte> privKeyBytes;
+
+        /// <summary>
+        /// Initialize new instance of CKey as copy of another instance.
+        /// </summary>
+        /// <param name="key">New CKey instance.</param>
+        public CKey(CKey key)
+        {
+            privKeyBytes = key.privKeyBytes;
+        }
+
+        /// <summary>
+        /// Initialize new instance of CKey using supplied byte sequence.
+        /// </summary>
+        /// <param name="bytes">New CKey instance.</param>
+        public CKey(IEnumerable<byte> bytes)
+        {
+            privKeyBytes = new List<byte>(bytes);
+        }
+
+        /// <summary>
+        /// Calculate public key for this private key.
+        /// </summary>
+        /// <returns>New CPubKey instance.</returns>
         public CPubKey GetPubKey()
         {
             // stub
 
-            return new CPubKey();
+            return new CPubKey((CPubKey)null);
         }
     }
 }