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(); } } } } }
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); } } } }