int packetType = decrypt[0]&0xff;
switch (packetType)
{
case 00:
InitLS init = new InitLS(decrypt);
if (Config.DEBUG) _log.info("Init received");
if(init.getRevision() != REVISION)
{
//TODO: revision mismatch
_log.warning("/!\\ Revision mismatch between LS and GS /!\\");
break;
}
try
{
KeyFactory kfac = KeyFactory.getInstance("RSA");
BigInteger modulus = new BigInteger(init.getRSAKey());
RSAPublicKeySpec kspec1 = new RSAPublicKeySpec(modulus, RSAKeyGenParameterSpec.F4);
_publicKey = (RSAPublicKey)kfac.generatePublic(kspec1);
if (Config.DEBUG) _log.info("RSA key set up");
}