I want to install a certificate on a machine if it doesn't have it installed already. I tried checking if the store contains the certificate but somehow my store is always empty. I checked "Intermediate Certification Authorities" folder and found 18 certificates there. So why does this code write 0?
X509Store store = new X509Store(StoreName.CertificateAuthority, StoreLocation.LocalMachine);
Console.WriteLine(store.Certificates.Count);
I also tried StoreLocation.CurrentUser. What am I doing wrong?