public SendableObject(SmartFox conn, bool encrypt) { provider = EncryptionProvider.GetInstance(); sendEncrypted = encrypt; connection = conn; data = new SFSObject(); }
public override void OnHandleMessage(Sfs2X.Entities.Data.ISFSObject data) { ServerPublicKey pubKey = new ServerPublicKey(); pubKey.FromSFSObject(data); EncryptionProvider.GetInstance().SetServerPublicKeyParameters(pubKey.parameters); }
public override ISFSObject ToSFSObject() { EncryptionProvider provider = EncryptionProvider.GetInstance(); ISFSObject tr = new SFSObject(); tr.PutByteArray("mod", new ByteArray(provider.ClientRSA.ExportParameters(false).Modulus)); tr.PutByteArray("exp", new ByteArray(provider.ClientRSA.ExportParameters(false).Exponent)); return(tr); }
protected void Awake() { handlers = new Dictionary <string, IMessageHandler>(); Application.runInBackground = true; if (SmartFoxConnection.IsInitialized) { smartFox = SmartFoxConnection.Connection; } else { smartFox = new SmartFox(debug); } // Create encryption provider provider = EncryptionProvider.GetInstance(); smartFox.AddEventListener(SFSEvent.EXTENSION_RESPONSE, OnExtensionResponse); }
protected ReceivableObject(bool encrypted) { provider = EncryptionProvider.GetInstance(); receiveEncrypted = encrypted; }