Validating x509 certificates c