19package com.basistech.df.cybertriage.autopsy.ctoptions.ctcloud;
21import com.basistech.df.cybertriage.autopsy.ctapi.json.LicenseInfo;
22import com.basistech.df.cybertriage.autopsy.ctapi.json.LicenseResponse;
23import com.basistech.df.cybertriage.autopsy.ctapi.util.LicenseDecryptorUtil;
24import com.basistech.df.cybertriage.autopsy.ctapi.util.ObjectMapperUtil;
25import com.fasterxml.jackson.core.JsonProcessingException;
26import com.fasterxml.jackson.databind.ObjectMapper;
28import java.io.IOException;
29import java.nio.file.Paths;
30import java.util.Optional;
31import java.util.logging.Level;
32import org.sleuthkit.autopsy.coreutils.Logger;
33import org.sleuthkit.autopsy.coreutils.PlatformUtil;
56 if (licenseFile.exists()) {
57 return licenseFile.delete();
64 if (licenseResponse !=
null) {
67 licenseFile.getParentFile().mkdirs();
70 }
catch (IOException ex) {
71 logger.log(Level.WARNING,
"There was an error writing CyberTriage license to file: " + licenseFile.getAbsolutePath(), ex);
79 Optional<LicenseResponse> toRet = Optional.empty();
81 if (licenseFile.exists() && licenseFile.isFile()) {
84 }
catch (IOException ex) {
85 logger.log(Level.WARNING,
"There was an error reading CyberTriage license to file: " + licenseFile.getAbsolutePath(), ex);
97 logger.log(Level.WARNING,
"There was an error decrypting license data from license file", ex);
98 return Optional.empty();
LicenseInfo createLicenseInfo(LicenseResponse licenseResponse)
static LicenseDecryptorUtil getInstance()
ObjectMapper getDefaultObjectMapper()
static ObjectMapperUtil getInstance()
synchronized boolean saveLicenseResponse(LicenseResponse licenseResponse)
static final String MALWARE_INGEST_SETTINGS_FILENAME
synchronized boolean deleteLicenseResponse()
static final String CT_SETTINGS_DIR
static final CTLicensePersistence instance
static final Logger logger
File getMalwareIngestFile()
static CTLicensePersistence getInstance()
synchronized Optional< LicenseResponse > loadLicenseResponse()
static final String CT_LICENSE_FILENAME
synchronized Optional< LicenseInfo > loadLicenseInfo()
final ObjectMapper objectMapper
synchronized static Logger getLogger(String name)