title: How to overwrite CN in Bouncy Castle X500Name?
body: <p>I'm signing CSRs in Java using Bouncy Castle. When signing, I want to copy the X500Name for subject from the CSR into the certificate, however I want to replace the CN that comes from CSR with a custom CN. Basically, clone the subject rdn list but overwrite, or create a custom CN for the certificate. </p>
  
  <p>Basically, I'm looking for something like:</p>
  
  <pre><code>X500Name xname = CSR.getSubject();
  xname.update("CN", "mycustomcn");
  </code></pre>