开发者

How can I get the expiration date of a certificate by C# code? [duplicate]

This question already has an answer here: How c开发者_StackOverflow中文版an I get the expiration date of an intermediate certificate and trusted root certificate by C# code? (1 answer) Closed 9 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜