class SystemService {

    public byte[] generateInternalCsr(String distinguishedName) throws InvalidDistinguishedNameException {
        auditDataHelper.put(RestApiAuditProperty.SUBJECT_NAME, distinguishedName);
        byte[] csrBytes = null;
        try {
            KeyPair keyPair = CertUtils.readKeyPairFromPemFile(internalKeyPath);
            csrBytes = CertUtils.generateCertRequest(keyPair.getPrivate(), keyPair.getPublic(), distinguishedName);
        } catch (IllegalArgumentException e) {
            throw new InvalidDistinguishedNameException(e);
        } catch (IOException | NoSuchAlgorithmException | InvalidKeySpecException | OperatorCreationException e) {
            throw new DeviationAwareRuntimeException(e);
        }
        return csrBytes;
    }

    @Autowired public  SystemService(GlobalConfService globalConfService, ServerConfService serverConfService,
            AnchorRepository anchorRepository, ConfigurationVerifier configurationVerifier,
            CurrentSecurityServerId currentSecurityServerId,
            AuditDataHelper auditDataHelper);

}