// (c) 2006 Richard Grimes // www.grimes.demon.co.uk using System; using System.Security.Cryptography.X509Certificates; class App { static void Main(string[] args) { if (args.Length == 0) return; X509Certificate x509 = X509Certificate.CreateFromSignedFile(args[0]); Console.WriteLine( "Issued to {0}\nIssued by {1}\nSerial# {2}\n" + "From {3} To {4}\nAlgo {5} Params {6}\n" + "Format {7}\n" + "Cert Hash\n{8}\nCert Data\n{9}\nPublic Key\n{10}", x509.GetName(), x509.GetIssuerName(), x509.GetSerialNumberString(), x509.GetEffectiveDateString(), x509.GetExpirationDateString(), x509.GetKeyAlgorithm(), x509.GetKeyAlgorithmParametersString(), x509.GetFormat(), x509.GetCertHashString(), x509.GetRawCertDataString(), x509.GetPublicKeyString()); } }