Good afternoon, I am developing a system where it uses pfx certificate, as shown in the code below I pass the directory where it is, but I can not pass the password as a parameter, the main object of my system is to take the validity of the certificate .
public void ctf()
{
// Caminho do certificado
string Certificate = "C: CERTIFICADO.PFX";
// Carregar o certificado em um objeto X509Certificate
X509Certificate cert = X509Certificate.CreateFromCertFile(Certificate);
// pega o valor( validade)
string results = cert.GetExpirationDateString();
// Exibe
Console.WriteLine(results);
}