public static void CleanupTrustList(ICertificateStore store, bool dispose = true) { var certs = store.Enumerate().Result; foreach (var cert in certs) { store.Delete(cert.Thumbprint); } var crls = store.EnumerateCRLs(); foreach (var crl in crls) { store.DeleteCRL(crl); } if (dispose) { store.Dispose(); } }