Saif Khan
Saif Khan

Reputation: 18772

Open pfx certificate container in .NET

Where can I find information on opening a PFX store which contains a certificate? I came across this, however I am kind of loast at the PfxOpen Class.

Edit - I have a pfx file exported with a private key. I am storing that in my database. I want to be able to open the pfx file and read information from the certificate contained in that pfx file, example the serial, expiration date etc.

Upvotes: 3

Views: 2023

Answers (1)

Chloé
Chloé

Reputation: 458

X509Certificate2 cert = new X509Certificate2(filename, password)

from there you can see what's in the cert. the X509Certificate2 has many overloads. check it out.

Upvotes: 4

Related Questions