//【查看证书吊销列表】 private void menuCertOfRevoke_ShowCRL_Click(object sender, EventArgs e) { try { var crlFilePath = Config.CADATA_DIR.TrimEnd('\\') + @"\crl\crl.pem"; if (!File.Exists(crlFilePath)) { var text = "当前库中没有证书吊销列表!\n\n您是否要立即生成证书吊销列表并查看?"; var confirm = MessageBox.Show(this, text, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (confirm == DialogResult.No) { return; } caDataHelper.GenCRL(crlFilePath, this.caPassword);//生成证书吊销列表 } //---- var title = "查看-证书吊销列表"; var info = caDataHelper.GetCRLText(crlFilePath); var form = new FormShowText(title, info); form.ShowDialog(); } catch (Exception ex) { MessageBox.Show(this, ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//查看-证书内容 private void ShowCert(string certFilePath) { if (!File.Exists(certFilePath)) { MessageBox.Show(this, "证书文件不存在!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var title = "查看-证书"; var info = caDataHelper.GetCertText(certFilePath); var form = new FormShowText(title, info); form.ShowDialog(this); }
//右键菜单-【查看】 private void menuRequestOfReject_Show_Click(object sender, EventArgs e) { if (gridRequestOfReject.SelectedRows.Count == 0) { return; } var reqFilePath = gridRequestOfReject.SelectedRows[0].Cells["RequestOfReject_FilePath"].Value.ToString(); var title = "查看-证书申请"; var info = caDataHelper.GetRequestText(reqFilePath); var form = new FormShowText(title, info); form.ShowDialog(); }