def from_serialized(klass, data): d = json.loads(data) self = klass(d["appid"].encode("ascii"), d["relay"].encode("ascii")) self._set_code_and_channel_id(d["code"].encode("ascii")) self.side = d["side"].encode("ascii") self.sp = SPAKE2_Symmetric.from_serialized(json.dumps(d["spake2"])) self.msg1 = d["msg1"].decode("hex") return self
def from_serialized(klass, data): d = json.loads(data) self = klass(d["appid"].encode("ascii"), d["relay"].encode("ascii")) self._set_code_and_channel_id(d["code"].encode("ascii")) self.side = d["side"].encode("ascii") self.sp = SPAKE2_Symmetric.from_serialized(json.dumps(d["spake2"])) self.msg1 = d["msg1"].decode("hex") return self
def from_serialized(klass, data): d = json.loads(data) self = klass(d["appid"], d["relay_url"]) self._side = d["side"] self._channelid = d["channelid"] self._set_code(d["code"]) sp_data = json.dumps(d["spake2"]).encode("ascii") self._sp = SPAKE2_Symmetric.from_serialized(sp_data) self._msg1 = unhexlify(d["msg1"].encode("ascii")) return self