class CsarExporter {

    public CompletableFuture<String> writeCsarAndSaveManifestInProvenanceLayer(IRepository repository, DefinitionsChildId entryId, OutputStream out)
        throws IOException, RepositoryCorruptException, AccountabilityException, InterruptedException, ExecutionException {
        LocalDateTime start = LocalDateTime.now();
        AccountabilityManager accountabilityManager = AccountabilityManagerFactory.getAccountabilityManager();

        Map<String, Object> exportConfiguration = new HashMap<>();
        exportConfiguration.put(CsarExportConfiguration.INCLUDE_HASHES.name(), null);
        exportConfiguration.put(CsarExportConfiguration.STORE_IMMUTABLY.name(), null);

        String manifestString = this.writeCsar(repository, entryId, out, exportConfiguration);
        String qNameWithComponentVersionOnly = VersionUtils.getQNameWithComponentVersionOnly(entryId);
        LOGGER.debug("Preparing CSAR export (provenance) lasted {}", Duration.between(LocalDateTime.now(), start).toString());

        return accountabilityManager.storeFingerprint(qNameWithComponentVersionOnly, manifestString);
    }

}