Validate X509 certificate.