public static X509Certificate toX509Cert(X509CertificateHolder certHolder)
    throws CertificateException {
    return new JcaX509CertificateConverter().setProvider(BouncyCastleProvider.PROVIDER_NAME)
      .getCertificate(certHolder);
  }
Convenience method to convert a bouncycastle X509CertificateHolder to a java X509Certificate.
@param certHolder a bouncycastle X509CertificateHolder.
@return a java X509Certificate
@throws CertificateException if the conversion fails.
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestHelpers.java