Пример #1
0
 public PipelineReceiverFor(IConsumerFor <T> consumer, ISerializer serializer, ICryptography cryptography, ILogger <IPipelineReceiverFor <T> > logger)
 {
     this.consumer     = consumer;
     this.serializer   = serializer;
     this.cryptography = cryptography;
     this.logger       = logger;
 }
Пример #2
0
 public ExecutionEngine(IScriptContainer container, ICryptography crypto, IScriptTable table = null, InteropService service = null)
 {
     this.ScriptContainer = container;
     this.Crypto          = crypto;
     this.table           = table;
     this.Service         = service ?? new InteropService();
 }
Пример #3
0
 public UsuarioHandler(IMapper mapper, IRepositoryBase <Usuario> repository, IHandlerBase handlerBase, ICryptography cryptography)
 {
     _mapper       = mapper;
     _repository   = repository;
     _handlerBase  = handlerBase;
     _cryptography = cryptography;
 }
Пример #4
0
    /// <summary>
    /// 加密模块的创建
    /// </summary>
    /// <param name="type">加密类型</param>
    /// <param name="key">加密密钥</param>
    private static ICryptography GetService(ServiceType type, string key)
    {
        ICryptography _cryptography = null;

        if (type.Equals(ServiceType.AES))
        {
            AESService aes = new AESService();
            aes.Key       = key;
            _cryptography = aes;
        }
        else if (type.Equals(ServiceType.DES))
        {
            ThreeDesService des = new ThreeDesService();
            des.Key       = key;
            _cryptography = des;
        }
        else if (type.Equals(ServiceType.RSA))
        {
            RSAService rsa = new RSAService();
            rsa.PublicKey = key;
            _cryptography = rsa;
        }
        else
        {
        }
        return(_cryptography);
    }
Пример #5
0
        public WebDavManager(ICryptography cryptography, IWebDavAuthorizationService webDavAuthorizationService)
        {
            _cryptography = cryptography;
            _webDavAuthorizationService = webDavAuthorizationService;

            _webDavSession = new WebDavSession();
        }
 public SenderPipelineFor(ISenderFor <T> sender, ICryptography cryptography, ISerializer serializer, ILogger <ISenderPipelineFor <T> > logger)
 {
     this.sender       = sender;
     this.cryptography = cryptography;
     this.serializer   = serializer;
     this.logger       = logger;
 }
Пример #7
0
        public LoginViewModel(IStorage storage) : base(storage)
        {
            Title = "Login";
            LoginActionCommand = new Command(async(user) => await ExecuteLoginActionCommand(user));

            cryptographic = new SHA256Cryptography();
        }
Пример #8
0
 internal ExecutionContext(ExecutionEngine engine, byte[] script, int rvcount)
 {
     this.Script   = script;
     this.RVCount  = rvcount;
     this.OpReader = new BinaryReader(new MemoryStream(script, false));
     this.crypto   = engine.Crypto;
 }
 public CreateUserCommandHandler(IUserRepository userRepository,
                                 EventHandler eventHandler,
                                 ICryptography cryptography) : base(eventHandler)
 {
     this.userRepository = userRepository;
     this.cryptography   = cryptography;
 }
Пример #10
0
        public WebDavManager(ICryptography cryptography, IWebDavAuthorizationService webDavAuthorizationService)
        {
            _cryptography = cryptography;
            _webDavAuthorizationService = webDavAuthorizationService;

            _webDavSession = new WebDavSession();
        }
Пример #11
0
 public RecepcionarImagemTScan(
     ICryptography crypto,
     IFileSystem fileSystem)
 {
     this.crypto     = crypto;
     this.fileSystem = fileSystem;
 }
 public DecipherText(CipherText cipherText, string key, ICryptography decryptor)
 {
     CipherText     = cipherText;
     DecipheredText = decryptor.Decrypt(cipherText, key);
     Key            = key;
     Score          = new FrequencyAnalysis(DecipheredText).Score;
 }
Пример #13
0
 public ChangePasswordController(CBAContext context, ICryptography crypto, IEmailService emailService, IOptions <EmailConfig> emailConfig, IHostingEnvironment env)
 {
     _context          = context;
     _crypto           = crypto;
     this.emailService = emailService;
     this.emailConfig  = emailConfig.Value;
     _env = env;
 }
Пример #14
0
 //This is not a proper currency code validation. This should be improved.
 public void Validate(string dataToValidate, bool isEncrypted, ICryptography cryptography, out string errorMessage)
 {
     errorMessage = string.Empty;
     if (!dataToValidate.All(char.IsLetter) || dataToValidate.Trim().Length != 3)
     {
         errorMessage = "Currency code is invalid";
     }
 }
Пример #15
0
        public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService)
        {
            _cryptography = cryptography;
            _authenticationService = authenticationService;
            _smsAuthService = smsAuthService;

            Log = LogManager.GetLogger(this.GetType());
        }
 public void Validate(string dataToValidate, bool isEncrypted, ICryptography cryptography, out string errorMessage)
 {
     errorMessage = string.Empty;
     if (dataToValidate.Any(char.IsDigit))
         errorMessage = "The Name field must not have numbers!";
     else if (dataToValidate.Trim() == string.Empty)
         errorMessage = "The Name field is required!";
 }
Пример #17
0
        public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService)
        {
            _cryptography          = cryptography;
            _authenticationService = authenticationService;
            _smsAuthService        = smsAuthService;

            Log = LogManager.GetLogger(this.GetType());
        }
Пример #18
0
        public WebDavManager(ICryptography cryptography, IWebDavAuthorizationService webDavAuthorizationService)
        {
            _cryptography = cryptography;
            _webDavAuthorizationService = webDavAuthorizationService;
            Log = LogManager.GetLogger(this.GetType());

            _webDavSession = new WebDavSession();
        }
Пример #19
0
        public Password(string password, ICryptography cryptography)
        {
            Value             = password;
            this.cryptography = cryptography;
            Validate();

            Value = cryptography.HashPassword(Value);
        }
Пример #20
0
 private Account(ICryptography cryptography, string name, AgentId id)
 {
     _cryptography = cryptography;
     Name          = name;
     Id            = id;
     Self          = CreateSelf();
     SetRelationWeight(Id, Id, Weight.Max);
 }
Пример #21
0
        public WebDavManager(ICryptography cryptography, IWebDavAuthorizationService webDavAuthorizationService)
        {
            _cryptography = cryptography;
            _webDavAuthorizationService = webDavAuthorizationService;
            Log = LogManager.GetLogger(this.GetType());

            _webDavSession = new WebDavSession();
        }
Пример #22
0
 public OwaController(IWopiServer wopiServer, IWebDavManager webDavManager, IAuthenticationService authenticationService, IAccessTokenManager tokenManager, ICryptography cryptography, ICobaltManager cobaltManager)
 {
     _wopiServer = wopiServer;
     _webDavManager = webDavManager;
     _authenticationService = authenticationService;
     _tokenManager = tokenManager;
     _cryptography = cryptography;
     _cobaltManager = cobaltManager;
 }
Пример #23
0
 public OwaController(IWopiServer wopiServer, IWebDavManager webDavManager, IAuthenticationService authenticationService, IAccessTokenManager tokenManager, ICryptography cryptography, ICobaltManager cobaltManager)
 {
     _wopiServer            = wopiServer;
     _webDavManager         = webDavManager;
     _authenticationService = authenticationService;
     _tokenManager          = tokenManager;
     _cryptography          = cryptography;
     _cobaltManager         = cobaltManager;
 }
Пример #24
0
 public PasswordManagementController(UserManager <IdentityUser> userManager,
                                     IEmailService emailService,
                                     ICryptography cryptography,
                                     IConfiguration configuration)
 {
     this.userManager   = userManager;
     this.emailService  = emailService;
     this.cryptography  = cryptography;
     this.configuration = configuration;
 }
Пример #25
0
 public LoginController(ILogger <LoginController> logger,
                        ICorporateUserQuery corporateUserQuery,
                        ICorporateSignInManager corporateSignInManager,
                        ICryptography cryptography,
                        IOptions <AppSettings> appSettings) : base(logger, corporateUserQuery)
 {
     _corporateSignInManager = corporateSignInManager;
     _appSettings            = appSettings.Value;
     _cryptography           = cryptography;
 }
Пример #26
0
 public RegistrationController(UserManager <IdentityUser> userManager,
                               RoleManager <IdentityRole> roleManager,
                               ICryptography cryptography,
                               IQueueService queueService)
 {
     this.userManager  = userManager;
     this.roleManager  = roleManager;
     this.cryptography = cryptography;
     this.queueService = queueService;
 }
Пример #27
0
        public RemoteClientState(ILogger logger, string ipAddress, int port, ICryptography cryptography)
        {
            _logger = logger;
            _buffer = new byte[4 * 1024];

            Port         = port;
            IpAddress    = ipAddress;
            Cryptography = cryptography;
            Tcp          = new TcpClient();
        }
        public UserController(IUnitOfWork unitOfWork, ICryptography cryptography,
                              ITokenProcessor tokenProcessor, TokenConfiguration tokenConfiguration, IRandomGenerator randomGenerator, IEmailer emailer) : base(unitOfWork)
        {
            _cryptography    = cryptography;
            _tokenProcessor  = tokenProcessor;
            _randomGenerator = randomGenerator;
            _emailer         = emailer;

            _tokenConfiguration = tokenConfiguration;
        }
Пример #29
0
 public AuthenticationController(UserManager <IdentityUser> userManager,
                                 SignInManager <IdentityUser> signInManager,
                                 ICryptography cryptography,
                                 IConfiguration configuration,
                                 ILogger <AuthenticationController> logger,
                                 ICodesServices codesServices)
 {
     this.userManager       = userManager;
     this.logger            = logger;
     authenticationStrategy = new AuthenticationStrategy(userManager, signInManager, cryptography, configuration, logger, codesServices);
 }
Пример #30
0
        public FileSystemController(ICryptography cryptography, IWebDavManager webdavManager, IAuthenticationService authenticationService, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService, FileOpenerManager openerManager, IUserSettingsManager userSettingsManager)
        {
            _cryptography = cryptography;
            _webdavManager = webdavManager;
            _authenticationService = authenticationService;
            _tokenManager = tokenManager;
            _webDavAuthorizationService = webDavAuthorizationService;
            _userSettingsManager = userSettingsManager;

            _openerManager = new FileOpenerManager();
        }
        public RavenDBAuthentication(IDatabase database,
            ICryptography cryptography,
            IConfiguration configuration)
        {
            _database = database;
            _cryptography = cryptography;
            _configuration = configuration;

            Mapper.CreateMap<RavenUser, User>();
            Mapper.CreateMap<User, RavenUser>();
        }
Пример #32
0
        public FileSystemController(ICryptography cryptography, IWebDavManager webdavManager, IAuthenticationService authenticationService, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService, FileOpenerManager openerManager, IUserSettingsManager userSettingsManager)
        {
            _cryptography               = cryptography;
            _webdavManager              = webdavManager;
            _authenticationService      = authenticationService;
            _tokenManager               = tokenManager;
            _webDavAuthorizationService = webDavAuthorizationService;
            _userSettingsManager        = userSettingsManager;

            _openerManager = new FileOpenerManager();
        }
Пример #33
0
 public SignUpController(ILogger <SignUpController> logger,
                         IScanCenterProfileQuery scanCenterProfileQuery,
                         IScanCenterSignInManager scanCenterSignInManager,
                         ICryptography cryptography,
                         IEmailManager emailManager,
                         IOptions <AppSettings> appSettings) : base(logger, scanCenterProfileQuery)
 {
     _scanCenterSignInManager = scanCenterSignInManager;
     _cryptography            = cryptography;
     _emailManager            = emailManager;
     _appSettings             = appSettings.Value;
 }
Пример #34
0
        public AccountController(CBAContext context,
                                 ICryptography crypto,
                                 SignInManager <CBAUser> signInManager,
                                 UserManager <CBAUser> userManager)
        {
            _context = context;

            //Dependency Injection
            _crypto        = crypto;
            _signInManager = signInManager;
            _userManager   = userManager;
        }
Пример #35
0
 public DataValidationControl(ICryptography _cryptography, IAuthService _authService)
 {
     validationRule = new List <IValidationRules>
     {
         new CreditCardNumberValidator(),
         new ExpiryValidator(),
         new NameValidator(),
         new SecurityValidator(),
         new AmountValidator(),
         new CurrencyValidator()
     };
     cryptography = _cryptography;
     authService  = _authService;
 }
Пример #36
0
 public DashboardController(
     ILogger <LoginController> logger,
     IScanCenterProfileQuery scanCenterProfileQuery,
     ICryptography cryptography,
     IScanCenterAppointmentQuery scanCenterAppointmentQuery,
     ICorporateUserQuery corporateUserQuery,
     IOptions <AppSettings> appSettings)
     : base(logger, corporateUserQuery)
 {
     _scanCenterAppointmentQuery = scanCenterAppointmentQuery;
     _scanCenterProfileQuery     = scanCenterProfileQuery;
     _cryptography = cryptography;
     _appSettings  = appSettings.Value;
 }
        public FormsAuthenticationService(ICryptography cryptography)
        {
            Log.WriteStart("FormsAuthenticationService");

            _cryptography = cryptography;

            try
            {
                _principalContext = new PrincipalContext(ContextType.Domain, WebDavAppConfigManager.Instance.UserDomain);
            }
            catch (Exception ex)
            {

                Log.WriteError(ex);
            }

            Log.WriteEnd("FormsAuthenticationService");
        }
Пример #38
0
 public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService)
 {
     _cryptography = cryptography;
     _authenticationService = authenticationService;
     _smsAuthService = smsAuthService;
 }
 public FormsAuthenticationService(ICryptography cryptography)
 {
     _cryptography = cryptography;
     _principalContext = new PrincipalContext(ContextType.Domain, WebDavAppConfigManager.Instance.UserDomain);
 }