def METHOD_NAME(self, msg, state, key_size=0):
    """
    Use to 'update' the AccessToken Request.
    :param msg:
    :param state: Used to map access token response to this request
    :param key_size:
    :return:
    """
    if not key_size:
        key_size = self.key_size
    key = RSAKey(key=RSA.generate(key_size))
    self.state2key[state] = key
    msg["key"] = json.dumps(key.serialize())
    return msg