if ((request.getIssuerPrivateKey() != null) && (request.getIssuerCertificate() != null)) {
builder = new JcaX509v3CertificateBuilder(request.getIssuerCertificate(), request.getSerialNumber(), request.getNotBefore(), request.getNotAfter(), request.getSubjectAsX500Principal(), request.getPublicKey());
if (request.isCa()) {
AuthorityKeyIdentifier authorityKeyIdentifier = new JcaX509ExtensionUtils().createAuthorityKeyIdentifier(request.getIssuerCertificate().getPublicKey());
builder.addExtension(X509Extension.authorityKeyIdentifier, false, authorityKeyIdentifier);
}
SubjectKeyIdentifier subjectKeyIdentifier = new JcaX509ExtensionUtils().createSubjectKeyIdentifier(request.getIssuerCertificate().getPublicKey());
builder.addExtension(X509Extension.subjectKeyIdentifier, false, subjectKeyIdentifier);