* added desktop client

Signed-off-by: CubeBit <denis-seredenko@ukr.net>
This commit is contained in:
2023-08-02 12:14:50 +02:00
parent 7508801049
commit 251532493f
11 changed files with 438 additions and 10 deletions

View File

@@ -0,0 +1,3 @@
module org.orinprojects.server {
exports org.orinprojects.encryption;
}

View File

@@ -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;
}