Viewing X509 Certificates with .NET

M. Gallant 05/14/2002

.NET provides cryptographic capability, including the ability to load and parse X509 v3 digital certificates. Unfortunately, the current implementation only supports reading X509 certificate files in binary DER format (and not the common Base-64 encoded version). The certinfo.cs C# application demonstrates how to easily read a certificate file containing either of these formats using try/catch clauses with the System.Security.Cryptography.CryptographicException and System.FormatException exceptions.

Note that the Authenticode native tool certmgr.exe can parse certificate file (stores) in any of the formats exportable by the cryptoAPI GUI certificate manager in win32:

certinfo.cs

Michel I. Gallant
neutron@istar.ca