public void Deserialize(IValueReader reader, RSACrypto crypto) { if (reader == null) { throw new ArgumentNullException("reader"); } if (crypto == null) { throw new ArgumentNullException("crypto"); } if (reader.ReadBool()) { byte[] exponent = crypto.Decrypt(reader.ReadBytes()); byte[] modulus1 = crypto.Decrypt(reader.ReadBytes()); byte[] modulus2 = crypto.Decrypt(reader.ReadBytes()); byte[] modulus = modulus1.Concat(modulus2).ToArray(); this.exponentOffset = modulus.Length; this.publicKey = new byte[exponent.Length + modulus.Length]; Buffer.BlockCopy(modulus, 0, this.publicKey, 0, modulus.Length); Buffer.BlockCopy(exponent, 0, this.publicKey, exponentOffset, exponent.Length); } SetupSignature(); }
public override void ReadPayload(IValueReader reader) { base.ReadPayload(reader); var internalEndPointAddress = new IPAddress(reader.ReadBytes()); InternalOwnEndPoint = new IPEndPoint(internalEndPointAddress, reader.ReadInt32()); var externalEndPointAddress = new IPAddress(reader.ReadBytes()); ExternalPeerEndPoint = new IPEndPoint(externalEndPointAddress, reader.ReadInt32()); }
public override void ReadPayload(IValueReader reader) { base.ReadPayload(reader); var internalEndPointAddress = new IPAddress(reader.ReadBytes()); InternalPeerEndPoint = new IPEndPoint(internalEndPointAddress, reader.ReadInt32()); var externalEndPointAddress = new IPAddress(reader.ReadBytes()); ExternalPeerEndPoint = new IPEndPoint(externalEndPointAddress, reader.ReadInt32()); }
public override void ReadPayload(IValueReader reader) { base.ReadPayload(reader); var endPointAddress = new IPAddress(reader.ReadBytes()); RegisteredEndPoint = new IPEndPoint(endPointAddress, reader.ReadInt32()); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { this.TargetType = (TargetType)reader.ReadByte(); ushort numTargets = reader.ReadUInt16(); int[] targets = new int[numTargets]; for (int i = 0; i < targets.Length; ++i) { targets[i] = reader.ReadInt32(); } TargetIds = targets; Sequence = reader.ReadInt32(); SourceId = reader.ReadInt32(); byte frames = reader.ReadByte(); Data = new byte[frames][]; for (int i = 0; i < frames; ++i) { Data[i] = reader.ReadBytes(); } }
public RSAParameters Deserialize(ISerializationContext context, IValueReader reader) { return(new RSAParameters { D = reader.ReadBytes(), DP = reader.ReadBytes(), DQ = reader.ReadBytes(), Exponent = reader.ReadBytes(), InverseQ = reader.ReadBytes(), Modulus = reader.ReadBytes(), P = reader.ReadBytes(), Q = reader.ReadBytes() }); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { SourceId = reader.ReadInt32(); Sequence = reader.ReadInt32(); byte frames = reader.ReadByte(); Data = new byte[frames][]; for (int i = 0; i < frames; ++i) { Data[i] = reader.ReadBytes(); } }
public void Deserialize(ISerializationContext context, IValueReader reader) { if (reader == null) { throw new ArgumentNullException("reader"); } if (reader.ReadBool()) { this.publicKey = reader.ReadBytes(); this.exponentOffset = reader.ReadInt32(); } SetupSignature(); }
private object SerializableDeserializer(IValueReader reader) { bool isNull = false; if (this.type.IsClass) { isNull = reader.ReadBool(); } if (isNull) { return(null); } byte[] data = reader.ReadBytes(); using (MemoryStream stream = new MemoryStream(data)) return(new BinaryFormatter().Deserialize(stream, null)); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { var ms = new MemoryStream(reader.ReadBytes()); ScreenFrame = new Bitmap(ms); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { this.TargetType = (TargetType)reader.ReadByte(); ushort numTargets = reader.ReadUInt16(); int[] targets = new int[numTargets]; for (int i = 0; i < targets.Length; ++i) targets[i] = reader.ReadInt32(); TargetIds = targets; Sequence = reader.ReadInt32(); SourceId = reader.ReadInt32(); byte frames = reader.ReadByte(); Data = new byte[frames][]; for (int i = 0; i < frames; ++i) Data[i] = reader.ReadBytes(); }
public override void ReadPayload(IValueReader reader) { base.ReadPayload(reader); var endPointAddress = new IPAddress(reader.ReadBytes()); InternalClientEndPoint = new IPEndPoint(endPointAddress, reader.ReadInt32()); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { AESKey = reader.ReadBytes(); PublicAuthenticationKeyType = Type.GetType (reader.ReadString()); PublicAuthenticationKey = reader.ReadBytes(); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { AESKey = reader.ReadBytes(); PublicAuthenticationKeyType = Type.GetType(reader.ReadString()); PublicAuthenticationKey = reader.ReadBytes(); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { SourceId = reader.ReadInt32 (); Sequence = reader.ReadInt32(); byte frames = reader.ReadByte(); Data = new byte[frames][]; for (int i = 0; i < frames; ++i) Data[i] = reader.ReadBytes(); }
public override void ReadPayload(ISerializationContext context, IValueReader reader) { OriginalMessageId = reader.ReadUInt16(); Count = reader.ReadByte(); Payload = reader.ReadBytes(); }
public void Deserialize(IValueReader reader, RSACrypto crypto) { if (reader == null) throw new ArgumentNullException ("reader"); if (crypto == null) throw new ArgumentNullException ("crypto"); if (reader.ReadBool()) { byte[] exponent = crypto.Decrypt (reader.ReadBytes()); byte[] modulus1 = crypto.Decrypt (reader.ReadBytes()); byte[] modulus2 = crypto.Decrypt (reader.ReadBytes()); byte[] modulus = modulus1.Concat (modulus2).ToArray(); this.exponentOffset = modulus.Length; this.publicKey = new byte[exponent.Length + modulus.Length]; Buffer.BlockCopy (modulus, 0, this.publicKey, 0, modulus.Length); Buffer.BlockCopy (exponent, 0, this.publicKey, exponentOffset, exponent.Length); } SetupSignature(); }
public void Deserialize(ISerializationContext context, IValueReader reader) { if (reader == null) throw new ArgumentNullException ("reader"); if (reader.ReadBool()) { this.publicKey = reader.ReadBytes(); this.exponentOffset = reader.ReadInt32(); } SetupSignature(); }