title: generate key and certificate using keytool
body: <p>I want to generate a self signed trusted certificate and a csr and sign the csr with trusted certificate created. I am trying it with keytool. In the first step of creating a trusted certificate using the below command </p>
  
  <p>keytool -genkey -alias mytrustCA -keyalg RSA -keystore keystore.jks -keysize 1024</p>
  
  <p>where it puts the certificate into keystore. How can I store it to a file ? and when I list the contents using </p>
  
  <p>keytool -list -v -keystore cert/test.keystore</p>
  
  <p>Certificate created with above "genkey" command creates with entry type as "PrivateKeyEntry", how can create a trusted Cert Entry ? </p>