def is_key_exchange(message):
    """
    Checks that message has key_exchange data.
    Return key or None.
    """
    try:
        if message['action'] == 'key_exchange':
            return message['key']
    except Exception:
        pass
    return None
