public Task <string> Ls(string disk, string path) { return(Task.Run(() => { var process = CreateProcess(LsArgument(disk, path)); process.Start(); process.StandardInput.WriteLine(_password.Get()); var output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); return output; })); }
public void Save(PasswordStore password) { using (var sw = new StreamWriter(ConfigFile)) { sw.WriteLine( StringCipher.Encrypt(JsonConvert.SerializeObject(this), password.Get()) ); } }
private static Config Deserialize(PasswordStore password) { if (!File.Exists(ConfigFile)) { return(new Config()); } var content = File.ReadAllText(ConfigFile); var settings = JsonConvert.DeserializeObject <Config>(StringCipher.Decrypt(content, password.Get())); settings.AfterDeserialization(); return(settings); }