public X509Certificate generateSignedCertificate(String dn, KeyPair keyPair,
                int daysBeforeNow, int daysAfterNow, String issuer, KeyPair parentKeyPair, boolean isCA, boolean isServerCert, boolean isClientCert)
                throws CertificateException {
            X500Name issuerOrDn = (issuer != null) ? new X500Name(issuer) : new X500Name(dn);
            return generateSignedCertificate(new X500Name(dn), keyPair, daysBeforeNow, daysAfterNow,
                    issuerOrDn, parentKeyPair, isCA, isServerCert, isClientCert);
        }
@param dn The distinguished name to use
@param keyPair A key pair to use
@param daysBeforeNow how many days before now the Certificate is valid for
@param daysAfterNow how many days from now the Certificate is valid for
@param issuer The issuer name. if null, "dn" is used
@param parentKeyPair The parent key pair used to sign this certificate. If null, create
       self-signed certificate authority (CA)
@return A (self-) signed certificate
@throws CertificateException
clients/src/test/java/org/apache/kafka/test/TestSslUtils.java