private void btnCheckSignature_Click(object sender, EventArgs e) { try { if (Signing.CheckSignature(openFileDialog1.FileName)) { MessageBox.Show("Dokument nije promijenjen"); } else { MessageBox.Show("Dokument je promijenjen!!!"); } } catch (FileNotFoundException ex) { MessageBox.Show(ex.Message); } catch (FormatException ex) { MessageBox.Show("Dokument je promijenjen!!!"); } catch (KriviUnosException ex) { MessageBox.Show(ex.Message); } }
private void btnSignPlaintext_Click(object sender, EventArgs e) { try { string name = openFileDialog1.FileName.Split('\\').Last(); string sigName = Signing.GenerateSignature(openFileDialog1.FileName); MessageBox.Show("Potpisana datoteka " + name + "\nStvorena datoteka potpisa " + sigName); } catch (FileNotFoundException ex) { MessageBox.Show(ex.Message); } }