if (applicationLink.isEncrypted()) {
// Non-interactive mode
if (masterPassword != null) {
logger.log(Level.INFO, " - Link is encrypted. Password available.");
SaltedSecretKey masterKey = createMasterKeyFromPassword(masterPassword, applicationLink.getMasterKeySalt());
TransferSettings transferSettings = applicationLink.createTransferSettings(masterKey);
configTO.setMasterKey(masterKey);
configTO.setTransferSettings(transferSettings);
}
else {
logger.log(Level.INFO, " - Link is encrypted. Asking for password.");
boolean retryPassword = true;
while (retryPassword) {
// Ask password
masterPassword = getOrAskPassword();
// Generate master key
SaltedSecretKey masterKey = createMasterKeyFromPassword(masterPassword, applicationLink.getMasterKeySalt());
// Decrypt config
try {
TransferSettings transferSettings = applicationLink.createTransferSettings(masterKey);