I have already developed a grizzly-based-HTTP-Server. In order to test my Server I also developed a grizzly-based-Client, which can comunicate with my Server using http-Messages. I instantiate my http-Server using grizzly as following:
HttpServer server = HttpServer.createSimpleServer();
server.addListener(new NetworkListener("server","127.0.01",8081);
server.getServerConfiguration().addHttpHandler(new Handler());
try {
server.start();
Thread.currentThread().join();
} catch (IOException e) {
e.printStackTrace();
}catch (InterruptedException e) {
e.printStackTrace();
}
Now I want to secure the communication between them. When I am searching for Informations about possible implementation of ssl in grizzly, I found this link SSL with Grizzly and Jersey. I noticed that I should use SSLContextConfigurator combined with Jersey. This means for me that I must modify my grizzly based Server, which is totally based on grizzly. Before doing this step, I must be sure that I can implement my AES-preshared-key using Jersey Combined with grizzly. Till now I found no example that Shows how to use AES-preshared-key in Java.
According to my readings about preshared-key-method, I knew that I should use javax.crypto.Cipher. Now I am confused about adding this functinality(ssl with preshared key) to my Server. Any idea?