title: How can I create a keystore using an existing CSR file?
body: <p>I have a website in GoDaddy (Apache) and an application in Amazon AWS (Apache Tomcat).</p>
  
  <p><strong>Website domain (apache): example.com</strong></p>
  
  <p><strong>Application domain (apache tomcat): sub.example.com</strong></p>
  
  <p>I know how to install the certificate for example.com in GoDaddy, I use this application to generate the CSR and Private Key: </p>
  
  <p><a href="https://www.rapidsslonline.com/ssl-tools/csr-generator.php" rel="nofollow noreferrer">https://www.rapidsslonline.com/ssl-tools/csr-generator.php</a></p>
  
  <p>I copy the CSR to request the certificate and finally install it fine using the private key.</p>
  
  <p>I know how to install the certificate in tomcat for sub.example.com creating a keystore then requesting the signature using the csr of the keystore generated and finally downloading the certificate and installing it, that's easy.</p>
  
  <p>But I have a problem, <strong>I can use only one solution : Install the website certificate or install the tomcat certificate, but not both.</strong> Why? Because the CSR generated by the generator is different of the generated by the keystore, and I need the private key (that the generator gives).</p>
  
  <p>Then, that's the reason of my question, how can I create a keystore using an existing CSR file? </p>
  
  <p>Well my idea is to create the keystore using that CSR file (maybe exists a parameter for keytool), then using it to generate a new certificate. After this I can install in Apache and tomcat, How can I do it? </p>
  
  <p>Maybe another solution is how to get the Private Key of a keystore, it will works too. </p>