Exemplo n.º 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();
                        }
                    }
                }
            }
        }
Exemplo n.º 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);
                    }
                }
            }
        }