Ejemplo n.º 1
0
        public static EncryptionRequest Deserialize(ref SpanReader br)
        {
            string serverID        = br.ReadAsString();
            uint   publicKeyLength = br.ReadAsVarInt(out _);

            byte[] publicKey         = br.ReadAsByteArray((int)publicKeyLength);
            uint   verifyTokenLength = br.ReadAsVarInt(out _);

            byte[] verifyToken = br.ReadAsByteArray((int)verifyTokenLength);

            return(new EncryptionRequest
            {
                ServerID = serverID,
                PublicKeyLength = publicKeyLength,
                PublicKey = publicKey,
                VerifyTokenLength = verifyTokenLength,
                VerifyToken = verifyToken
            });
        }