title: Keytool error: java.lang.Exception: Failed to parse input
body: <p>This question may be duplicate, but i am not able to get the solution,
  I tried to create SSL certificate with following commands,</p>
  
  <pre><code>C:\Program Files\Java\jdk1.6.0_05\bin&gt;keytool -genkey -alias tomcat -keyalg RSA
  -keystore E:\key
  Enter keystore password:
  Re-enter new password:
  What is your first and last name?
    [Unknown]:  Raghu
  What is the name of your organizational unit?
    [Unknown]:  BFS
  What is the name of your organization?
    [Unknown]:  iGate
  What is the name of your City or Locality?
    [Unknown]:  Bang
  What is the name of your State or Province?
    [Unknown]:  KA
  What is the two-letter country code for this unit?
    [Unknown]:  IN
  Is CN=Raghu, OU=BFS, O=iGate, L=Bang, ST=KA, C=IN correct?
    [no]:  y
  
  Enter key password for &lt;tomcat&gt;
          (RETURN if same as keystore password):
  Re-enter new password:
  </code></pre>
  
  <p>I have tried get certificate request using following command</p>
  
  <pre><code>C:\Program Files\Java\jdk1.6.0_05\bin&gt;keytool -certreq -v -alias tomcat -keyalg
  RSA -keystore E:\key
  Enter keystore password:
  </code></pre>
  
  <p>And got following response in the command prompt</p>
  
  <pre><code>**-----BEGIN NEW CERTIFICATE REQUEST----- MIIBlzCCAQACAQAwVzELMAkGA1UEBhMCSU4xCzAJBgNVBAgTAktBMQ0wCwYDVQQHEwRCYW5nMQ4w
  DAYDVQQKEwVpR2F0ZTEMMAoGA1UECxMDQkZTMQ4wDAYDVQQDEwVSYWdodTCBnzANBgkqhkiG9w0B
  AQEFAAOBjQAwgYkCgYEA0Aoxz2V/Cqs00d7d4iVysIcfMxXDA4ydD5+AY2Q2hPqIOAbfrz0HiSjZ
  JwKV0/g7P/oWPU9fCFYnLXAynusbaAtw5xIolMNqj9gtxmD1BzrwxcVIX3oWY0LzO768TMY3Szjp
  tS64z5q1KSTYqeZww0f11N2JssjtMch8gw50FIcCAwEAAaAAMA0GCSqGSIb3DQEBBQUAA4GBAK1v
  sE0BNxGrGKNBXhYuSdgwF14ZnELtjWBzDJDzbzgJbK6RJlOEstKxdStR2fq7iv0ow+Df7TnVWidm
  +0PRLuhtr3DMZVX2acNQY4c4ynKWgLyBV2lAXbYfgZdzQr3ClY+40lkbmHQaMxZcxz2q7u8Np6sH
  n0iytY6U0CqJpRcB
  ----END NEW CERTIFICATE REQUEST-----**
  </code></pre>
  
  <p>And I am saved in cert.txt file and to Verify the Certificate Reply</p>
  
  <pre><code> C:\Program Files\Java\jdk1.6.0_05\bin&gt;keytool -printcert -file E:\cert.txt
  
  **keytool error: java.lang.Exception: Failed to parse input**
  </code></pre>
  
  <p>I got the above error. please suggest for the same.</p>