How can I get the expiration date of a certificate by C# code? [duplicate]
How can I get the expiration date of a certificate by C# code?
I need to get data about a certificate in Internet Options (-> content -> certificates).
Use X509Store class to access certificates in Windows Certificate Storages. Then check NotAfter property of the certificate of your choice, accesible via X509Certificate2 class.
Help topic for X509Store class contains the sample how to enumerate certificates and read their properties.
Here is a bourne shell script to check the same.
精彩评论