/* If the given key is contained in the list, returns TRUE. Returns FALSE otherwise.  */
gboolean key_is_in_list(decryption_key_t *dk, GList *list)
/* If the given key is contained in the list, returns TRUE. Returns FALSE otherwise.  */
gboolean key_is_in_list(decryption_key_t *dk, GList *list)
{
    guint i,n;
    decryption_key_t *curr_key = NULL;
    gboolean found = FALSE;
    if ( (list == NULL) || (dk == NULL) )
        return FALSE;
    n = g_list_length(list);
    if (n < 1)
        return FALSE;
    for(i = 0; i < n; i++)
    {
        curr_key = (decryption_key_t*)g_list_nth_data(list,i);
        if (keys_are_equals(dk,curr_key))
            found = TRUE;
    }
    return found;
}