Exemple #1
0
 public Handler(IMediator mediator, ZSocket zSocket, ZCryptography zCryptography, AuthService authService)
 {
     _mediator      = mediator;
     _zSocket       = zSocket;
     _zCryptography = zCryptography;
     _authService   = authService;
 }
 public Handler(ZSocket zsck, IOptions <IdentitySettings> identitySettings,
                ZCryptography zCryptography,
                AuthService authService)
 {
     _zsck             = zsck;
     _identitySettings = identitySettings.Value;
     _zCryptography    = zCryptography;
     _authService      = authService;
 }
Exemple #3
0
 public CommandController(
     IOptions <AzenSettings> azenSettings,
     ZSocket zSocket,
     LogHandler logHandler,
     IMediator mediator,
     ZCryptography zCryptography)
 {
     _azenSettings  = azenSettings;
     _logHandler    = logHandler;
     _zsck          = zSocket;
     _mediator      = mediator;
     _zCryptography = zCryptography;
 }
        public void Plain_text_to_cipher_and_visceversa_works_well()
        {
            var plainText = "1234";

            ZCryptographySettings zCriptographySettings = new ZCryptographySettings();

            zCriptographySettings.Key = "$B&E)H@McQfTjWnZr4u7x!A%C*F-JaNd";
            zCriptographySettings.IV  = "z%C*F-JaNdRgUkXp";

            /*
             * zCriptographySettings.Key = "$B&E)H@McQfTjWnZr4u7x!A%C*F-JaNd";
             * zCriptographySettings.IV = "z%C*F-JaNdRgUkXp";
             */
            IOptions <ZCryptographySettings> settingsOptions = Options.Create(zCriptographySettings);

            ZCryptography zCriptography     = new ZCryptography(settingsOptions);
            var           cipherText        = zCriptography.GetCipherText(plainText);
            var           plainTextReversed = zCriptography.GetPlainText(cipherText);

            Assert.Equal(plainText, plainTextReversed);
        }