title: How to get RSA key from -----BEGIN CERTIFICATE----- from.crt and .pem file?
body: <p>I'm having .crt and .pem file with </p>
  
  <pre><code>-----BEGIN CERTIFICATE-----
  
  MIIFSDCCBDCg........................................
  
  -----END CERTIFICATE-----
  </code></pre>
  
  <p>and I want RSA key from this file. </p>
  
  <p>anyone is having any idea that how we can do that.</p>
  
  <p>I have used below command one by one</p>
  
  <pre><code>openssl rsa -in XXX.crt -out input1.der -outform DER
  openssl rsa -in input1.der -inform DER -out key.pem -outform PEM
  </code></pre>
  
  <p>But, It gives error:</p>
  
  <blockquote>
    <p>unable to load Private Key 140331982231200:error:0906D06C:PEM<br>
    routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY
    PRIVATE KEY</p>
  </blockquote>
  
  <p>and I have also used different command but it give above error.</p>