private void btnCargarFirma_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open)) { XadesService xadesService = new XadesService(); var firmas = xadesService.Load(fs); FrmSeleccionarFirma frm = new FrmSeleccionarFirma(firmas); if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _signatureDocument = frm.FirmaSeleccionada; ValidationResult result = xadesService.Validate(_signatureDocument); if (!result.IsValid) { MessageBox.Show(result.Message, "FIRMA NO VÁLIDA"); } } else { MessageBox.Show("Debe seleccionar una firma."); } } } }