props.setProperty(PROPS_INDIVIDUAL_KEY, individualName);
props.setProperty(PROPS_CV_VERSION_KEY, CentraViewConfiguration.getVersion());
logger.debug("fetchLicenseFile: ServerProperties being sent: ");
logger.debug(props);
Key blowfishKey = LicenseUtil.generateBlowfishKey();
byte[] encryptedServerData = LicenseUtil.encryptServerData(blowfishKey, props);
byte[] encryptedBlowfishKey = LicenseUtil.encryptBlowfishKey(blowfishKey);
Byte[] byteArrayServerData = (Byte[])LicenseUtil.convertToObjectArray(encryptedServerData);
Byte[] byteArrayKeyData = (Byte[])LicenseUtil.convertToObjectArray(encryptedBlowfishKey);
byte[] encryptedResponse = LicenseUtil.obtainLicenseFile(byteArrayKeyData, byteArrayServerData);
logger.debug("fetchLicenseFile: Response Size: "+encryptedResponse.length+" bytes.");
if (encryptedResponse.length < 1) {
throw new AxisFault(SERVER_DOWN_MESSAGE);
}
logger.debug("fetchLicenseFile: Writing new license to disk.");
File centraViewLicenseFile = LicenseUtil.getCentraViewLicenseFile(dataSource);
LicenseUtil.writeLicenseFileToDisk(encryptedResponse, centraViewLicenseFile);
logger.debug("fetchLicenseFile: Decrpting License.");
byte[] encryptedLicenseFile = LicenseUtil.getLicenseFromLicenseFile(encryptedResponse);
byte[] encryptedKey = LicenseUtil.getKeyFromLicenseFile(encryptedResponse);
Key newBlowfishKey = LicenseUtil.decryptBlowfishKey(encryptedKey);
Properties licenseFile = LicenseUtil.decryptLicenseFile(newBlowfishKey, encryptedLicenseFile);
logger.debug("fetchLicenseFile: The recieved license file:");
logger.debug(licenseFile);
//do SHA to make sure is valid
//save data to database.