// It's up to the caller to decide whether to wait until this function completes. public Task Save() { return(Task.Run(() => { using (var fs = new FileStream(_path, FileMode.Create)) { VaultMarshal.Marshal(_accessPassword, _accountData, fs); } })); }
// Builds a vault from a given source. public PasswordVault(string vaultPath, string accessPassword, Stream stream) { _path = vaultPath; _accessPassword = accessPassword; _accountData = VaultMarshal.Unmarshal(stream, accessPassword); }