title: How to use X509Extension value?
body: <p>1) </p>
  
  <pre><code>byte[] crldpExt = cert.getExtensionValue(X509Extensions.CRLDistributionPoints.getId());
  String skiOid = X509Extensions.AuthorityKeyIdentifier.getId();
  </code></pre>
  
  <p><code>CRLDistributionPoints</code> and <code>AuthorityKeyIdentifier</code> are deprecated in Bouncy Castle 1.46. According to the GrepCode <code>X509Extension</code> value should be used at this place. But i am not getting "How to use". </p>
  
  <p>2) <code>V3TBSCertificateGenerator.setSubject(x500Name);</code></p>
  
  <p>According to the new document, It should work. But it is giving the error that it is not applicable for argument (<code>X500Name</code>) change it to (<code>X509Name</code>). But <code>X509Name</code> is deprecated.</p>
  
  <p>3)</p>
  
  <pre><code>X509Principal principal = PrincipalUtil.getSubjectX509Principal(x509cert);
  Vector &lt;?&gt; values = principal.getValues(X509Name.CN);
  if (cn != null)
      certificate.setCn(cn.get(0).toString());
  </code></pre>
  
  <p>As <code>X509Name</code> is deprecated. That is why i changed this to following :</p>
  
  <pre><code>X500Name x500name = new JcaX509CertificateHolder(x509cert).getSubject();
  RDN[] cn = null;
  cn = x500name.getRDNs(BCStyle.CN);
  if (cn != null)
      certificate.setCn(cn.toString());
  </code></pre>
  
  <p>Is it correct. Please let me know if i am wrong.</p>