Pass the certificate password v

Asked

Viewed 303 times

3

Good afternoon, I am developing a system where it uses certificate pfx, as it shows the code below I pass the directory where it is, but I cannot pass the password as 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);

}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.