I am trying to export a cert without the private key as as BASE-64 encoded file, same as exporting it from windows. When exported from windows I am able to open the .cer fil
try this:
X509Certificate2 cerifikata = new X509Certificate2("C://certificate.pfx"); File.WriteAllBytes("D://Test.cer",cerifikata.Export(X509ContentType.Cert));