''

@classmethod
def compute_one_way(cls, zone, from_device, to_device):

    assert (from_device.is_trusted() or (from_device.get_zone() == zone))
    chain = [{'device': from_device}]
    devices_in_chain = set([])
    for i in range(cls.MAX_CHAIN_LENGTH):
        cur_link = chain[(-1)]
        cur_link['zone_invitation'] = get_object_or_None(ZoneInvitation, used_by=cur_link['device'].signed_by, revoked=False)
        if cur_link['zone_invitation']:
            cur_link['zone_invitation'].verify()
        cur_link['device_zone'] = get_object_or_None(DeviceZone, device=cur_link['device'].signed_by, revoked=False)
        if ((not cur_link['zone_invitation']) and (not cur_link['device_zone'])):
            break
        elif ((cur_link['device'] == to_device) or cur_link['device'].is_trusted()):
            logging.debug('Found    end    of    chain!')
            break
        next_device = getattr(cur_link['zone_invitation'], 'invited_by', None)
        next_device = (next_device or getattr(cur_link['device_zone'], 'signed_by'))
        if (next_device in devices_in_chain):
            logging.warn('loop    detected.')
            break
        else:
            assert (next_device.is_trusted() or (next_device.get_zone() == zone))
            devices_in_chain.add(next_device)
            chain.append({'device': next_device})
    terminal_link = chain[(-1)]
    terminal_device = terminal_link['device']
    obj = (terminal_link['zone_invitation'] or terminal_link['device_zone'])
    if (obj and (not (terminal_device.is_creator(obj) or terminal_device.is_trusted()))):
        logging.warn('Could    not    verify    chain    of    trust.')
    return chain
