var cert = new X509Certificate2("path/to/certificate.cer");
var expiryDate = cert.NotAfter;
bool isValid = cert.Verify();
var publicKey = cert.PublicKey.Key;These examples use the X509Certificate2 class in the System.Security.Cryptography.X509Certificates package library.