free_tang_keys_info(struct tang_keys_info* tki)
{
    if (!tki) {
        return;
    }

    json_t* to_free[] = {tki->m_keys, tki->m_rotated_keys,
                         tki->m_payload, tki->m_sign
    };
    size_t len = sizeof(to_free) / sizeof(to_free[0]);

    for (size_t i = 0; i < len; i++) {
        if (to_free[i] == NULL) {
            continue;
        }
        json_decref(to_free[i]);
    }
    free(tki);
}
free_tang_keys_info(struct tang_keys_info* tki)
{
    if (!tki) {
        return;
    }

    json_t* to_free[] = {tki->m_keys, tki->m_rotated_keys,
                         tki->m_payload, tki->m_sign
    };
    size_t len = sizeof(to_free) / sizeof(to_free[0]);

    for (size_t i = 0; i < len; i++) {
        if (to_free[i] == NULL) {
            continue;
        }
        json_decref(to_free[i]);
    }
    free(tki);
}