Use X509Certificate instead of Certificate