public async Task <X509TrustList> GetTrustListAsync(string id)
        {
            const int PageSize  = 3;
            var       result    = new X509TrustList();
            var       trustList = await _opcServiceClient.GetCertificateGroupTrustListAsync(id, pageSize : PageSize).ConfigureAwait(false);

            while (trustList != null)
            {
                result.AddIssuerCertificates(trustList.IssuerCertificates);
                result.AddIssuerCrls(trustList.IssuerCrls);
                result.AddTrustedCertificates(trustList.TrustedCertificates);
                result.AddTrustedCrls(trustList.TrustedCrls);
                if (!String.IsNullOrEmpty(trustList.NextPageLink))
                {
                    trustList = await _opcServiceClient.GetCertificateGroupTrustListAsync(id, trustList.NextPageLink, PageSize).ConfigureAwait(false);
                }
                else
                {
                    trustList = null;
                }
            }
            return(result);
        }
Пример #2
0
 protected async Task UpdateTrustList(X509TrustList trustList)
 {
     await UpdateGroupStore(Configuration.TrustedListPath, trustList.TrustedCertificates, trustList.TrustedCrls);
     await UpdateGroupStore(Configuration.IssuerListPath, trustList.IssuerCertificates, trustList.IssuerCrls);
 }