title: Java - asymmetric encryption of traffic with pre-shared public keys and without trust store hassles
body: <p>I'm trying to communicate using RSA preshared keys and, ideally, <em>without</em> involving truststore shenanigans</p>
  
  <p>The setup is basically like this:</p>
  
  <p><em>There's an applet on client side and a servlet on server side (duh :) )</em></p>
  
  <p><em>The applet has servlet's RSA public key (Spub) hardcoded.</em></p>
  
  <p><em>The servlet has it's own RSA private key (Spriv) hardcoded.</em></p>
  
  <p><em>They applet generates a random AES 256 key (session key), encrypts it with servlet's public key (which it has hardcoded), connects to the servlet over a TCP socket and sends the RSA-encrypted key to the servlet, which proceeds to decrypt the session key and use it for any further communication with this applet as long as this socket connection lasts.</em></p>
  
  <p>I would rather do this all without messing with truststore and such (after all, it's a relatively straightforward setup which allows for a pre-shared hardcoded public key)</p>
  
  <p>Any suggestions in regards to where I should start looking to educate myself ?</p>