Active Directory Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail
How Long For Me
<< Back To All Blogs
Enumerating a user secure certificate store in C#
Tuesday, July 14th, 2009
Reading a user's certificate store can be a very useful thing in C#, especially when dealing with anything at a low-level Windows usage, such as checking to see if the user on a domain has a valid certificate to use an Encrypted File System (EFS).
It is pretty straight-forward, so without further ado, here is how it is done:
X509Store store = new
X509Certificate2 cert in
// Cert thumbprint
// Cert serial number
// Cert issuer
// Cert notbefore entry
DateTime notbefore =
// Cert notafter entry
DateTime notafter =
// Enumerate cert extensions, you can then cast them to their specific cert extension type if needed
X509Extension ext in
That's all I have for now, pretty short entry, but a useful bit of code.
X509in' Tom Out.
Determining if a computer is a laptop or desktop in C#
Retrieving Text from Win32 SDK's GetLastError() in C#
Enumerating all attributes of an element and adding them to a dictionary using LINQ with Lambda Expressions
Autostarting a Windows Service directly after install in C#
Reading Digital Signatures from InfoPath Forms in MOSS 2007 and WSS 3.0 Workflow
Currently no comments.
Add A Comment
Email Address: (not public, used to send notifications on further comments)
Enter the text above, except for the 1st and last character: