Example #1
0
 public MainWindow()
 {
     PGPOptions            = new PGPOptions();
     PGPEncryptFileOptions = new PGPEncryptFileOptions();
     PGPDecryptFileOptions = new PGPDecryptFileOptions();
     PGPGenerateKeyOptions = new PGPGenerateKeyOptions();
     DataContext           = this;
     InitializeComponent();
     Title = "{0} (v{1})".FormatString(Title, Assembly.GetEntryAssembly().GetName().Version);
 }
Example #2
0
        private async void btnDecrypt_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ChoPGPEncryptDecrypt pgp = PGPOptions.NewPGPEncryptDecrypt();
                await pgp.DecryptFileAsync(PGPDecryptFileOptions.InputFilePath, PGPDecryptFileOptions.OutputFilePath, PGPDecryptFileOptions.PrivateKeyFilePath, PGPDecryptFileOptions.PassPhrase);

                MessageBox.Show("PGP decryption successful.", Title, MessageBoxButton.OK, MessageBoxImage.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error occurred during PGP decryption. " + ex.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #3
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);
            }
        }