public FeeDisbursementManager(IReferenceManagement referenceManager, IOrderRepository orderRepository, ICryptographicProvider cryptographicProvider) { _cryptographicProvider = ValidationUtil.CheckOnNullAndThrowIfNull(cryptographicProvider); _referenceManager = ValidationUtil.CheckOnNullAndThrowIfNull(referenceManager); _orderRepository = ValidationUtil.CheckOnNullAndThrowIfNull(orderRepository); _dateTimeManager = new DateTimeManager(_referenceManager); }
public void TestInitialize() { _referenceManager = Substitute.For<IReferenceManagement>(); _orderRepository = Substitute.For<IOrderRepository>(); _dateTimeManager = new DateTimeManager(_referenceManager); _cryptographicProvider = Substitute.For<ICryptographicProvider>(); _feeDisbursementManager = new FeeDisbursementManager(_referenceManager, _orderRepository, _cryptographicProvider); }
public Startup(ISerializerFactory serializerFactory, ICryptographicProvider cryptographicProvider, IEncryptionService encryptionService, IMediator mediator, IEncodingProvider encodingProvider, IDomainEncryptionProvider domainEncryptionProvider, IConfiguration configuraton) { this.serializerFactory = serializerFactory; this.cryptographicProvider = cryptographicProvider; this.encryptionService = encryptionService; this.mediator = mediator; this.encodingProvider = encodingProvider; this.domainEncryptionProvider = domainEncryptionProvider; this.configuraton = configuraton; }
public FileUploadController(IDocumentService documentService, IAppraiserAccessManager appraiserAccessManager, IArchiveService archiveService, ICryptographicProvider cryptographicProvider, IOrderService orderService) { if (documentService == null) throw new ArgumentNullException("documentService"); if (appraiserAccessManager == null) throw new ArgumentNullException("appraiserAccessManager"); if (archiveService == null) throw new ArgumentNullException("archiveService"); if (cryptographicProvider == null) throw new ArgumentNullException("cryptographicProvider"); if (orderService == null) throw new ArgumentNullException("orderService"); _documentService = documentService; _appraiserAccessManager = appraiserAccessManager; _archiveService = archiveService; _orderService = orderService; _cryptographicProvider = cryptographicProvider; }
public AppraisalCompanyService(IAppraisalCompanyManagement appraisalCompanyManagement, IAppraiserManagement appraisalCompanyAdminManagement, IFeeManager feeManager, StatusHistoryManager statusHistoryManager, IReferenceManagement referenceManagement, ICryptographicProvider cryptographicProvider, IGeocodingDataService geocodingService) { _appraisalCompanyManagement = appraisalCompanyManagement; _appraisalCompanyAdminManagement = appraisalCompanyAdminManagement; _feeManager = feeManager; _referenceManagement = referenceManagement; _cryptographicProvider = cryptographicProvider; _addressManager = new AddressManager(referenceManagement); _phoneManager = new PhoneManager(); _statusHistoryManager = statusHistoryManager; _geocodingDataService = geocodingService; }
public OrderService(IOrderRepository orderRepository, IReferenceManagement referenceManagement, IGeocodingDataService geocodingDataService, ITaskManager taskManager, IOrderManager orderManager, IAppraisalFormsService appFormsService, IClientDashboardService dashboarService, IConfigurationHelper configurationHelper, ICryptographicProvider cryptographicProvider, IDocumentService documentService, IReportManager reportManager, ISecurityContext securityContext, IOrderDocumentsRepository orderDocumentsRepository) { _orderRepository = ValidationUtil.CheckOnNullAndThrowIfNull(orderRepository); _referenceManager = ValidationUtil.CheckOnNullAndThrowIfNull(referenceManagement); _geocodingDataService = ValidationUtil.CheckOnNullAndThrowIfNull(geocodingDataService); _taskManager = ValidationUtil.CheckOnNullAndThrowIfNull(taskManager); _orderManager = ValidationUtil.CheckOnNullAndThrowIfNull(orderManager); _appFormsService = ValidationUtil.CheckOnNullAndThrowIfNull(appFormsService); _dashboarService = ValidationUtil.CheckOnNullAndThrowIfNull(dashboarService); _configurationHelper = ValidationUtil.CheckOnNullAndThrowIfNull(configurationHelper); _cryptographicProvider = ValidationUtil.CheckOnNullAndThrowIfNull(cryptographicProvider); _documentService = ValidationUtil.CheckOnNullAndThrowIfNull(documentService); _reportManager = ValidationUtil.CheckOnNullAndThrowIfNull(reportManager); _securityContext = ValidationUtil.CheckOnNullAndThrowIfNull(securityContext); _orderDocumentsRepository = ValidationUtil.CheckOnNullAndThrowIfNull(orderDocumentsRepository); _addressManager = new AddressManager(_referenceManager); _dateTimeManager = new DateTimeManager(_referenceManager); }
public CryptographicDataProvider(IApplicationSettings applicationSettings, IEncodingProvider encodingProvider, ICryptographicProvider cryptographicProvider) { this.applicationSettings = applicationSettings; this.encodingProvider = encodingProvider; this.cryptographicProvider = cryptographicProvider; }
public ArchiveService(IDocumentService documentService, ICryptographicProvider cryptographicProvider) { _documentService = documentService; _cryptographicProvider = cryptographicProvider; }
public DatabaseProvider(ICryptographicProvider cryptographicProvider) { _cryptographicProvider = cryptographicProvider; _settings = new Lazy <Dictionary <string, string> >(ProcessAll); }
static void Main(string[] args) { //setup Dependency Injection ServiceProvider diServiceProvider = new ServiceCollection() .AddSingleton <ILoggerFactory, LoggerFactory>() .AddLogging(bldr => { bldr.AddConsole(); }) //add program specific implementations for interfaces .AddSingleton <ICryptographicProvider, AESProvider>() .BuildServiceProvider(); ILogger logger = diServiceProvider.GetService <ILoggerFactory>().CreateLogger <Program>(); try { Console.WriteLine("Please Log In"); Console.WriteLine("-----------------"); Console.Write("Username: "******"Password: "******"Validation against live database...\r\n"); using (FinanceContext context = new FinanceContext()) { //var hash = HashManager.GetHash(secPassword); //context.Add(new User() { UserName = userName, Password = hash }); //context.SaveChanges(); var foundUser = context.User.Where(u => u.UserName == userName).FirstOrDefault(); if (foundUser != null) { if (HashManager.Match(secPassword, foundUser.Password)) { logger.LogInformation($"user: {userName} authenticated...\r\n"); ICryptographicProvider provider = diServiceProvider.GetService <ICryptographicProvider>(); provider.Inititalize(secPassword); var encrypted = provider.Encrypt("this is a test"); Console.WriteLine(encrypted); Console.WriteLine(); var decrypted = provider.Decrypt(encrypted); Console.WriteLine(decrypted); } else { logger.LogInformation("incorrect password provided...\r\n"); Console.WriteLine("invalid user/pass."); } } else { logger.LogInformation("user not found...\r\n"); Console.WriteLine("invalid user/pass."); } }//end using } catch (Exception ex) { logger.LogError(ex, "Error occured...\r\n"); } }
/// <summary> /// QuickbloxClient ctor. /// </summary> /// <param name="applicationId">Quickblox application ID</param> /// <param name="authKey">Auth Key</param> /// <param name="authSecret">Auth Secret</param> /// <param name="apiEndpoint">API endpoint</param> /// <param name="chatEndpoint">XMPP chat endpoint</param> /// <param name="cryptographicProvider">HMAC SHA1 Cryptographic Provider</param> /// <param name="logger">Logger instance. Allows to log API calls, xmpp messages etc.</param> public QuickbloxClient(int applicationId, string authKey, string authSecret, string apiEndpoint, string chatEndpoint, ICryptographicProvider cryptographicProvider = null, ILogger logger = null) { if (apiEndpoint == null) { throw new ArgumentNullException(nameof(apiEndpoint)); } if (chatEndpoint == null) { throw new ArgumentNullException(nameof(chatEndpoint)); } if (authKey == null) { throw new ArgumentNullException(nameof(authKey)); } if (authSecret == null) { throw new ArgumentNullException(nameof(authSecret)); } if (cryptographicProvider == null) { cryptographicProvider = Resolver.Resolve <ICryptographicProvider>(); } if (logger != null) { LoggerHolder.LoggerInstance = logger; } ApplicationId = applicationId; AuthKey = authKey; AuthSecret = authSecret; ApiEndPoint = apiEndpoint; ChatEndpoint = chatEndpoint; this.AuthenticationClient = new AuthenticationClient(this, cryptographicProvider); this.ChatClient = new ChatClient(this); this.UsersClient = new UsersClient(this); this.NotificationClient = new NotificationClient(this); //this.LocationClient = new LocationClient(this); this.ChatXmppClient = new ChatXmppClient(this); this.WebSyncClient = new WebSyncClient(this); this.ContentClient = new ContentClient(this); this.CustomObjectsClient = new CustomObjectsClient(this); }
public DefaultDomainEncryptionProvider(ICryptographicProvider cryptographicProvider, IEncryptionService encryptionService) { _encryptionService = encryptionService; _cryptographicProvider = cryptographicProvider; }
internal AuthenticationClient(QuickbloxClient client, ICryptographicProvider cryptographicProvider) { this.quickbloxClient = client; this.cryptographicProvider = cryptographicProvider; }