You can simply pass the file name to the new () method.
Try:
X509Certificate2 x509 = new X509Certificate2(certificateFile);
If the certificate has a password, you must also specify it (where password is a string):
X509Certificate2 x509 = new X509Certificate2(certificateFile, password);
aaroncatlin
source share