Ejemplo n.º 1
0
        private void buttonOpen_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                RSACrypt.getParams(openFileDialog.FileName);
                textBoxPath.Text = RSACrypt.filePath;
            }
        }
Ejemplo n.º 2
0
 private void buttonPatch_Click(object sender, RoutedEventArgs e)
 {
     if (RSACrypt.HashAndSignBytes(keys.privateKey))
     {
         MessageBox.Show("Signed!");
     }
     else
     {
         MessageBox.Show("Error!");
     }
 }
Ejemplo n.º 3
0
        private void buttonCheck_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == true)
            {
                var file = File.ReadAllBytes(openFileDialog.FileName);
                if (RSACrypt.VerifySignedHash(file, keys.publicKey))
                {
                    MessageBox.Show("GOOD");
                }
                else
                {
                    MessageBox.Show("FAIL");
                }
            }
        }