Пример #1
0
        public static KeyAck Decode(G2ReceivedPacket packet)
        {
            KeyAck ka = new KeyAck();

            G2Header child = new G2Header(packet.Root.Data);

            while (G2Protocol.ReadNextChild(packet.Root, child) == G2ReadResult.PACKET_GOOD)
            {
                if (!G2Protocol.ReadPayload(child))
                {
                    continue;
                }

                if (child.Name == Packet_Key)
                {
                    ka.PublicKey = Utilities.ExtractBytes(child.Data, child.PayloadPos, child.PayloadSize);
                }
            }

            return(ka);
        }
Пример #2
0
        public static KeyAck Decode(G2ReceivedPacket packet)
        {
            KeyAck ka = new KeyAck();

            G2Header child = new G2Header(packet.Root.Data);

            while (G2Protocol.ReadNextChild(packet.Root, child) == G2ReadResult.PACKET_GOOD)
            {
                if (!G2Protocol.ReadPayload(child))
                    continue ;

                if (child.Name == Packet_Key)
                    ka.PublicKey = Utilities.ExtractBytes(child.Data, child.PayloadPos, child.PayloadSize);
            }

            return ka;
        }