コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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;
        }