コード例 #1
0
 // 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);
         }
     }));
 }
コード例 #2
0
 // Builds a vault from a given source.
 public PasswordVault(string vaultPath, string accessPassword, Stream stream)
 {
     _path           = vaultPath;
     _accessPassword = accessPassword;
     _accountData    = VaultMarshal.Unmarshal(stream, accessPassword);
 }