title: Generating the CSR using BouncyCastle API
body: <p>I am new to the security side of Java and stumbled across this library called BouncyCastle. But the examples that they provide and the ones out on the internet ask to use</p>
  <pre><code>return new PKCS10CertificationRequest(&quot;SHA256withRSA&quot;, new X500Principal(
      &quot;CN=Requested Test Certificate&quot;), pair.getPublic(), null, pair.getPrivate()
  </code></pre>
  <p>But when I use <code>PKCS10CertificationRequest</code>, it looks like it is deprecated. So I started looking at another method where I use <code>CertificationRequest</code> class. But I am really confused, the constructor does not take the same parameters instead it takes <code>CertificationRequestInfo</code> class which I am not sure how to fill up.</p>
  <pre><code>CertificationRequest request = new CertificationRequest(...);
  </code></pre>
  <p>It would be awesome if someone could help me figure out how to make a CSR so that I can send it to the server for getting it signed.</p>