c# Validating an X509Certificate2: am I doing this right?
问题 Using framework 4.5.1 and the following requirement, am I doing this right? the URL in the certificate must match the given URL the certificate must be valid and trusted the certificate must not be expired The following passes, but is this sufficient? In particular does the call to chain.Build(cert) satisfy #2 above? protected bool ValidateDigitalSignature(Uri uri) { bool isValid = false; X509Certificate2 cert = null; HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest; using