DhKeyGenerator keyGen = new DhKeyGenerator();
byte[] publicKey = keyGen.createPublicKey();
this.cryptor = keyGen.getSymmetricCryptor(serverPublicKey);
handshake.setPublicKey(publicKey);
} else {
this.cryptor = new NullCryptor();
}
this.socketChannel.write(handshake);
} catch (CryptoException err) {
throw new CommunicationException(err);