* added desktop client
Signed-off-by: CubeBit <denis-seredenko@ukr.net>
This commit is contained in:
3
server/src/main/java/module-info.java
Normal file
3
server/src/main/java/module-info.java
Normal file
@@ -0,0 +1,3 @@
|
||||
module org.orinprojects.server {
|
||||
exports org.orinprojects.encryption;
|
||||
}
|
||||
@@ -5,15 +5,14 @@ import org.orinprojects.encryption.EncryptionUtil;
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.Socket;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
public class ClientHandler implements Runnable {
|
||||
|
||||
@@ -64,6 +63,12 @@ public class ClientHandler implements Runnable {
|
||||
|
||||
if (prefix.equals("WLC")) {
|
||||
this.username = restMessage;
|
||||
//TODO: add better logic
|
||||
if (Server.clientKeys.get(username) != null) {
|
||||
in.close();
|
||||
out.close();
|
||||
clientSocket.close();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user