예제 #1
0
        private string GetCertificationInformationLabelData()
        {
            string infoText = _certificationInformationLabel.Text;

            string state    = PDFSignaturesHelper.GetState(_signature.State);
            string signedBy = PDFSignaturesHelper.GetSignedByString(_signature.CertificateInfo["Subject"]);

            return(string.Format(infoText, state, signedBy, state));
        }
예제 #2
0
        private void InitializeDetailsTab()
        {
            //Fiil DataGridView with the details of the signature
            foreach (KeyValuePair <string, string> entry in _signature.CertificateInfo)
            {
                DataGridViewRow row = CreateGridViewRow(entry.Key, entry.Value);
                _certificateDataGridView.Rows.Add(row);
            }

            _certificateDataGridView.Rows.Add(CreateGridViewRow("Version", _signature.Version.ToString()));
            _certificateDataGridView.Rows.Add(CreateGridViewRow("Valid To", _signature.ValidTo.ToLocalTime().ToString()));
            _certificateDataGridView.Rows.Add(CreateGridViewRow("Valid From", _signature.ValidFrom.ToLocalTime().ToString()));
            _certificateDataGridView.Rows.Add(CreateGridViewRow("KeyUsage", PDFSignaturesHelper.GetKeyUsageString(_signature.KeyUsage)));
        }
예제 #3
0
        private void InitializeSummaryTab()
        {
            _signatureValidityStateValueLabel.Text = PDFSignaturesHelper.GetState(_signature.State);

            _signedByValueLabel.Text = PDFSignaturesHelper.GetSignedByString(_signature.CertificateInfo["Subject"]);

            _issuedByValueLabel.Text = PDFSignaturesHelper.GetSignedByString(_signature.CertificateInfo["Issuer"]);

            _validFromValueLabel.Text = _signature.ValidFrom.ToLocalTime().ToString();

            _validToValueLabel.Text = _signature.ValidTo.ToLocalTime().ToString();

            _intededUsageValueLabel.Text = PDFSignaturesHelper.GetKeyUsageString(_signature.KeyUsage);

            _certificationInformationLabel.Text = GetCertificationInformationLabelData();
        }
예제 #4
0
        private void _certificateDataGridView_SelectionChanged(object sender, EventArgs e)
        {
            //Change The information data as the selected row.
            DataGridViewRow row = _certificateDataGridView.SelectedRows[0];

            string descriptionInfo = row.Cells[1].Value.ToString();

            if (row.Cells[0].Value.ToString() == "Issuer" || row.Cells[0].Value.ToString() == "Subject")
            {
                descriptionInfo = PDFSignaturesHelper.GetSubjcetOrIssure(descriptionInfo);
            }
            else if (row.Cells[0].Value.ToString() == "KeyUsage")
            {
                string keyUsageInfo = (string)row.Cells[1].Value;

                keyUsageInfo = keyUsageInfo.Replace(", ", System.Environment.NewLine);

                descriptionInfo = keyUsageInfo;
            }

            _valueDescriptionTextBox.Text = descriptionInfo;
        }
예제 #5
0
        private void SetCertificationInformation()
        {
            string state = PDFSignaturesHelper.GetState(_signature.State);

            _infoLabel.Text = string.Format(_infoLabel.Text, state);
        }