Use the X509Store class to access certificates in the Windows certificate store. Then check the NotAfter property of the certificate of your choice, accessible through the X509Certificate2 class.
The help section for the X509Store class contains an example of how to list certificates and read their properties.
source share