예제 #1
0
        public static void UnlockWallet()
        {
            if (privateKey == null)
            {
                var encryptedPrivateKey = StorageFileProvider <string> .GetModel(Constants.WalletEncryptedPrivateKeyFilePath);

                if (encryptedPrivateKey != null && encryptedPrivateKey != string.Empty)
                {
                    Console.WriteLine("Type your password:"******"Unlock wallet...");
                            var bytes = CryptographyUtilities.Decrypt(encryptedPrivateKey, password);

                            if (bytes != null && bytes.Length > 0)
                            {
                                privateKey = new BigInteger(bytes);
                            }

                            break;
                        }
                        catch
                        {
                            Console.WriteLine("Incorrect password...");
                            Console.WriteLine("Type your password again:");
                            password = Console.ReadLine();
                        }
                    }
                }
            }
        }
예제 #2
0
        public static void UnlockWallet()
        {
            if (privateKey == null)
            {
                var encryptedPrivateKey = StorageFileProvider <string> .GetModel(Constants.WalletEncryptedPrivateKeyFilePath);

                if (encryptedPrivateKey != null && encryptedPrivateKey != string.Empty)
                {
                    var password = "******";

                    var bytes = CryptographyUtilities.Decrypt(encryptedPrivateKey, password);

                    if (bytes != null && bytes.Length > 0)
                    {
                        privateKey = new BigInteger(bytes);
                    }
                }
            }
        }