private void SendRegisterInfo(QrCodeObject qrCodeObj) { JsonRemote message = new JsonRemote(); message.PublicKey = securityManager.GetPublicKey(); string content = JsonConvert.SerializeObject(message); string strToSend = securityManager.EncryptAndEncodeMessage(content); WriteToSocket(strToSend); }
public void SetConnectionWithInfo(string qrCodeInfo) { Console.WriteLine("WITH INFO FROM REGISTER"); QrCodeObject qrCodeObj = JsonConvert.DeserializeObject <QrCodeObject>(qrCodeInfo); securityManager = new SecurityManager(qrCodeObj.KcPub.RSAParameters, qrCodeObj.Kd); ConnectingToDevice(); SendRegisterInfo(qrCodeObj); Console.Write("END"); ListeningFromSocketAsync(); }