public BurpCertificate generateCertificate(BurpCertificate issuer) throws CertificateEncodingException, InvalidKeyException, IllegalStateException, NoSuchAlgorithmException, SignatureException, NoSuchProviderException, IOException, InvalidKeySpecException {
  if (privateKey == null || publicKey == null) {
    generateKeyPair();
  }
  burpCertificate=new BurpCertificate(generateX509Certificate(issuer.getPrivateKey()));
  burpCertificate.setPrivateKey(privateKey);
  burpCertificate.setPublicKey(publicKey);
  burpCertificate.setSource("Signed by " + issuer.getSubject());
  return burpCertificate;
}

public BurpCertificate generateCertificate ( BurpCertificate issuer ) throws CertificateEncodingException , InvalidKeyException , IllegalStateException , NoSuchAlgorithmException , SignatureException , NoSuchProviderException , IOException , InvalidKeySpecException { if ( privateKey == null || publicKey == null ) { generateKeyPair ( ) ; } burpCertificate = new BurpCertificate ( generateX509Certificate ( issuer . getPrivateKey ( ) ) ) ; burpCertificate . setPrivateKey ( privateKey ) ; burpCertificate . setPublicKey ( publicKey ) ; burpCertificate . setSource ( "Signed by " + issuer . getSubject ( ) ) ; return burpCertificate ; }
generates a new certificate and sets the fields private / public key and source of this object . the certificate is signed with the private key of the given issuer .
