def METHOD_NAME(config_file, site, key_id, rsa_private_key, rsa_public_key):
    config_obj = config.read_json_config_file(config_file, check_commands=False, add_defaults=False)
    site = config.get_site_from_config(config_obj, site)
    site_config = config_obj["backup_sites"][site]
    if key_id in site_config.setdefault("encryption_keys", {}):
        raise CommandError("key_id {!r} already defined for site {!r} in {!r}".format(key_id, site, config_file))
    site_config["encryption_keys"][key_id] = {
        "private": rsa_private_key,
        "public": rsa_public_key,
    }
    site_config["encryption_key_id"] = key_id
    write_json_file(config_file, config_obj)
    print("Saved new key_id {!r} for site {!r} in {!r}".format(key_id, site, config_file))
    print(
        "NOTE: The pghoard daemon does not require the 'private' key in its configuration file, "
        "it can be stored elsewhere to improve security"
    )