internal async Task _initKeyPair() { const string KEYS_FILENAME = ".keys"; KeyPair = new KeyPair(); if (await VFS.ExistsAsync(KEYS_FILENAME)) { using (var stream = new StreamReader(await VFS.ReadAsync(KEYS_FILENAME))) { var keyContents = stream.ReadLine(); KeyPair.LoadFrom(keyContents); } } else { KeyPair.Generate(); await VFS.CreateAsync(KEYS_FILENAME, false); using (var stream = new StreamWriter(await VFS.WriteAsync(KEYS_FILENAME))) { var keyContents = KeyPair.Save(); stream.WriteLine(keyContents); } } }