Ejemplo n.º 1
0
        private void FillStoreList(SYSTEM_STORE_NAMES store)
        {
            IDC_CERT_LIST.Clear();
            IDC_CERT_LIST.Columns.AddRange(storeHeaders);

            CLocalCertStoreImp localStore = new(store);

            IDC_CERT_LIST.Items.AddRange(localStore.GetCertificatesList().
                                         Select(c => new ListViewItem(new string[] { c.Subject, $"{c.Version}", c.Issuer })
            {
                Tag = c
            }).ToArray());

            IDC_CERT_LIST.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
Ejemplo n.º 2
0
        private void FillDeviceList()
        {
            IDC_CERT_LIST.Clear();
            IDC_CERT_LIST.Columns.AddRange(deviceHeaders);

            g_DeviceCertData.m_parCertificates          = new();
            (uint nStoredCertCount, uint nMaxCertCount) = g_DeviceCertData.m_iDevice.CertGetCertificatesCount();
            if (nStoredCertCount == 0)
            {
                return;
            }

            uint nNextCertIndex = 0U;

            do
            {
                CCertProperties certProperties = g_DeviceCertData.m_iDevice.CertGetCertificate(nNextCertIndex);
                g_DeviceCertData.m_parCertificates.Add(certProperties);
                nNextCertIndex = certProperties.nNextCertIndex;
                IDC_CERT_LIST.Items.Add(new ListViewItem(new string[] { $"{certProperties.nIndex}", certProperties.CertType, certProperties.ValidationPolicy, $"{certProperties.nSignerCertIndex}" }));
            } while (nNextCertIndex > 0);

            IDC_CERT_LIST.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }