Beispiel #1
0
 public static ConnectionDetails EncryptedToConnectionDetails(
     this IConfigurationSection ConnectionDetailSection,
     SigningService signingService)
 {
     return(new ConnectionDetails(
                signingService.Decrypt(ConnectionDetailSection[nameof(ConnectionDetails.DataSource)]),
                signingService.Decrypt(ConnectionDetailSection[nameof(ConnectionDetails.InitialCatalogue)]),
                signingService.Decrypt(ConnectionDetailSection[nameof(ConnectionDetails.UserId)]),
                signingService.Decrypt(ConnectionDetailSection[nameof(ConnectionDetails.Password)])
                ));
 }
Beispiel #2
0
        public void Run(
            [Option("e", "text to be encrypted")] string encrypt = "",
            [Option("d", "text to be decrypted")] string decrypt = "")
        {
            if (!string.IsNullOrWhiteSpace(encrypt))
            {
                Console.WriteLine(signingService.Encrypt(encrypt));
            }

            if (!string.IsNullOrWhiteSpace(decrypt))
            {
                Console.WriteLine(signingService.Decrypt(decrypt));
            }
        }