public static IEnumerable <Certificate> EnumerateCertificates(this CertificateStoreClient client, int chunkSize, CertificateGetOptions options) { if (options == null) { throw new ArgumentNullException("options"); } if (chunkSize < 1) { throw new ArgumentException("value was less than 1", "chunkSize"); } long lastID = -1; Certificate[] certs; while (true) { certs = client.EnumerateCertificates(lastID, chunkSize, options); if (certs.IsNullOrEmpty()) { yield break; } for (int i = 0; i < certs.Length; ++i) { yield return(certs[i]); } lastID = certs[certs.Length - 1].ID; } }
public static IEnumerable <X509Certificate2> EnumerateX509Certificates(this CertificateStoreClient client, int chunkSize) { foreach (Certificate cert in client.EnumerateCertificates(chunkSize, FullCertData)) { yield return(cert.ToX509Certificate()); } }
public static IEnumerable <Certificate> EnumerateCertificates(this CertificateStoreClient client, int chunkSize) { return(client.EnumerateCertificates(chunkSize, FullCertData)); }