use of com.tvd12.ezyfoxserver.response.EzyHandShakeResponse in project ezyfox-server by youngmonkeys.
the class EzyHandshakeController method newHandShakeResponse.
protected EzyResponse newHandShakeResponse(EzySession session, EzyHandshakeEvent event) {
EzyHandShakeParams params = new EzyHandShakeParams();
params.setServerPublicKey(session.getPublicKey());
params.setReconnectToken(session.getToken());
params.setSessionId(session.getId());
params.setSessionKey(event.getEncryptedSessionKey());
return new EzyHandShakeResponse(params);
}
use of com.tvd12.ezyfoxserver.response.EzyHandShakeResponse in project ezyfox-server by youngmonkeys.
the class EzyHandShakeResponseTest method test.
@Test
public void test() {
EzyHandShakeParams params = new EzyHandShakeParams();
params.setReconnectToken("123");
params.setServerPublicKey(new byte[0]);
params.setSessionId(1L);
params.setSessionKey(EzyAesCrypt.randomKey());
assert params.getSessionId() == 1L;
assert params.getReconnectToken().equals("123");
assert params.getServerPublicKey().length == 0;
assert params.getSessionKey() != null;
EzyHandShakeResponse response = new EzyHandShakeResponse(params);
response.serialize();
params.setServerPublicKey(null);
response.serialize();
response.release();
}
Aggregations