Add some more exception handling to X509 object.