class CertificateService {

    public CertificateResponse newCertificate(CertificateRequest certificateRequest) {
        SubjectData subjectData = generateSubjectData(certificateRequest);
        QCStatement qcStatement = generateQcStatement(certificateRequest);

        X509Certificate cert = generateCertificate(subjectData, qcStatement);

        return CertificateResponse.builder()
                   .privateKey(ExportUtil.exportToString(subjectData.getPrivateKey()))
                   .encodedCert(ExportUtil.exportToString(cert))
                   .build();
    }

}