private async void Button_Tapped(object sender, TappedRoutedEventArgs e) { byte[] message = Encoding.UTF8.GetBytes(message_textbox.Text); if (publicKey != null) { byte[] dataToSend = PGP.Encrypt(message, publicKey, true, true); await MailHelper.ComposeEmailAsync(contact, "Encoded message", string.Empty, "message.pgp", dataToSend); } }
private async void sharebutton_ontap(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { // Raw binary key byte[] key = await KeyStore.Instance.GetMyPublicKey(); if (key != null) { await MailHelper.ComposeEmailAsync(contact, "My public key", "", "publickey.pgpkey", key); this.Frame.Navigate(typeof(MainPage)); } else { MessageDialog msg = new MessageDialog("You have no private key", "Error"); await msg.ShowAsync(); } }