title: client side password encryption in login.js using RSA in javascript and decrypt in Server side in java
body: <p>I am working with struts login application
  I need to encrypt password in the login.js file using RSA public key in javascript and then decrypt it using RSA private key at server side in java.</p>
  
  <p>I have java code which generates the RSA public/private key in server side. And saved that keys in the server side.</p>
  
  <p>When user clicks on submit button after filling username and password, i will be encrypting the password using RSA public key which was generated in the server side. Than struts action will be executing which will do authentication using LDAP at server side.</p>
  
  <p><strong>But how can i transfer public key from server to client for encryption of password at client side when user click on the submit button.</strong></p>
  
  <p>Thanks in advance !!!</p>