public async Task DownloadFilesAsync() { var settings = ServiceSettings.GetSettings(); foreach (var endpoint in settings.Endpoints) { var decodedPass = new SimpleAES().DecryptString(endpoint.EncryptedPass); if (endpoint.Protocol == Protocol.Sftp) { await this.DownloadFilesWithSftpAsync(endpoint, decodedPass); } } }
private static int ValidateEncryptPassArg(int encryptPassArgPosition, params string[] args) { var encryptPassValuePosition = encryptPassArgPosition + 1; if (args.Length > encryptPassValuePosition) { var encryptPassValue = args[encryptPassValuePosition]; var encryptedValue = new SimpleAES().EncryptToString(encryptPassValue); Console.WriteLine("Passed value: {0}", args[encryptPassValuePosition]); Console.WriteLine("Encrypted value: {0}", encryptedValue); return 0; } Console.WriteLine("You've forgot value to encrypt."); return -1; }