Esempio n. 1
0
        private async void btnGenerateKey_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ChoPGPEncryptDecrypt pgp = PGPOptions.NewPGPEncryptDecrypt();
                await pgp.GenerateKeyAsync(PGPGenerateKeyOptions.PublicKeyFilePath, PGPGenerateKeyOptions.PrivateKeyFilePath, PGPGenerateKeyOptions.Identity, PGPGenerateKeyOptions.PassPhrase,
                                           PGPGenerateKeyOptions.Strength, PGPGenerateKeyOptions.Certainty);

                MessageBox.Show("PGP key generation successful.", Title, MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occurred during PGP key generation. " + ex.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }