title: Certificate signing request, certificate and private key MD5 matching
body: <p>I'm using custom library for CSR generation in iOS. For some reason, certificate is not matching with my keys.</p>
  
  <p>MD5 for private key:</p>
  
  <pre><code>openssl rsa -noout -modulus -in private19_ios.key | openssl md5
  (stdin)= 94e252d4246b96a0f15149d68e1c9868
  </code></pre>
  
  <p>MD5 for csr generated by custom library:</p>
  
  <pre><code>openssl req -noout -modulus -in CSR19_ios.csr | openssl md5
  (stdin)= 94e252d4246b96a0f15149d68e1c9868
  </code></pre>
  
  <p>MD5 for cert:</p>
  
  <pre><code>openssl x509 -noout -modulus -in cert19_1_ios.pem | openssl md5
  (stdin)= 7539a7817ce7843f2d7bbe89835bdc4d
  </code></pre>
  
  <p>As you can see, MD5:s of modulos matches in private key and csr, but not with certificate.</p>
  
  <p>Then I have used openssl to generate CSR. MD5 of that CSR is following:</p>
  
  <pre><code>openssl req -noout -modulus -in CSR19_openssl.csr | openssl md5
  (stdin)= 94e252d4246b96a0f15149d68e1c9868
  </code></pre>
  
  <p>Using this csr I got certificate that matches with my key md5:</p>
  
  <pre><code>openssl x509 -noout -modulus -in cert19_1_openssl.pem | openssl md5
  (stdin)= 94e252d4246b96a0f15149d68e1c9868
  </code></pre>
  
  <p>My question is, where do you think the error might be? Is the problem in the CSR even though MD5 of modulos matches in both custom library generated CSR and openssl generated CSR?</p>