code: public TBSCertificate buildTBSCertificate(PrincipalIndentifier subjectName,
          PublicKeyParameters subject, X509CertificateParameters parameters) throws IOException
      {
          PrincipalIndentifier issuerName;
          CertifiedPublicKey issuer = null;
  
          if (this.signer instanceof CertifyingSigner) {
              issuer = ((CertifyingSigner) this.signer).getCertifier();
              issuerName = issuer.getSubject();
          } else {
              issuerName = subjectName;
          }
  
          BcX509TBSCertificateBuilder builder = getTBSCertificateBuilder();
  
          builder.setSerialNumber(new BigInteger(128, this.random)).setIssuer(issuerName);
  
          addValidityDates(builder);
  
          extendsTBSCertificate(builder, issuer, subjectName, subject, parameters);
  
          return builder.setSubject(subjectName).setSubjectPublicKeyInfo(subject).setSignature(this.signer).build();
      }
docs: Build the TBS Certificate.
  
  @param subjectName the identifier of the public key owner.
  @param subject the public key to certify.
  @param parameters the subject parameters for this certificate.
  @return the TBS certificate.
  @throws IOException on encoding error.