/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="legalReceiver">The legal receiver</param>
 /// <param name="keyManager">Key manager</param>
 /// <param name="logger">Logger</param>
 public DecryptRequestFilter(
     IKeyManager keyManager,
     ILogger <DecryptRequestFilter> logger)
 {
     this.keyManager = keyManager;
     this.logger     = logger;
 }
예제 #2
0
 public TPMContext(string deviceName, TPMWrapper tpm)
 {
     _deviceName        = deviceName;
     _tpm               = tpm;
     _authHandleManager = new AuthHandleManager(this);
     _keyManager        = new KeyManager(this);
 }
예제 #3
0
        public HomeController(IDataProtectionProvider provider, IKeyManager keyManager)
        {
            var dataProtector = provider.CreateProtector("W3E72EFS4MN9LOP0FDWJ7F6E0FSW");

            _timeLimitedDataProtector = dataProtector.ToTimeLimitedDataProtector();
            _keyManager = keyManager;
        }
 public ValuesController(IDataProtectionProvider provider, IKeyManager keyManager)
 {
     _provider                 = provider;
     _dataProtector            = provider.CreateProtector("3BCE558E2AD3E0E34A7743EAB5AEA2A9BD2575A0");
     _timeLimitedDataProtector = _dataProtector.ToTimeLimitedDataProtector();
     _keyManager               = keyManager;
 }
        internal KeyManager()
        {
            string currentKeyManagementSystem = ConfigurationManager.AppSettings["currentKeyManagementSystem"];

            switch (currentKeyManagementSystem)
            {
            case "simple":
                ActualKeyManager = new SimpleKeyManager();
                break;

            case "knox":
                ActualKeyManager = new KnoxKeyManager();
                break;

            case "vault":
                ActualKeyManager = new VaultKeyManager();
                break;

            case "keywhiz":
                ActualKeyManager = new KeywhizKeyManager();
                break;

            case "barbican":
                ActualKeyManager = new BarbicanKeyManager();
                break;

            case "conjur":
                ActualKeyManager = new ConjurKeyManager();
                break;

            default:
                throw new NotImplementedException();
            }
        }
예제 #6
0
파일: TPMContext.cs 프로젝트: deveck/doTSS
 public TPMContext(string deviceName, TPMWrapper tpm)
 {
     _deviceName = deviceName;
     _tpm = tpm;
     _authHandleManager = new AuthHandleManager(this);
     _keyManager = new KeyManager(this);
 }
예제 #7
0
 public void Save()
 {
     Key.name        = Name;
     Key.title       = Title;
     Key.description = Description;
     Key.notes       = Notes;
     Key.copyright   = Copyright;
     Key.Publish     = Publish;
     if (Key.id == 0)
     {
         IKeyManager.Insert(Key);
     }
     else
     {
         IKeyManager.Update(Key);
     }
     foreach (var literature in LiteratureItems)
     {
         if (_originalLiteratureItems.Contains(literature))
         {
             IKeyManager.Update(literature);
             _originalLiteratureItems.Remove(literature);
         }
         else
         {
             literature.key_id = Key.id;
             IKeyManager.Insert(literature);
         }
     }
     foreach (var literature in _originalLiteratureItems)
     {
         IKeyManager.Delete(literature);
     }
     _originalLiteratureItems.Clear();
 }
        public string PassPhrase => IsPasswordSet ? "Please confirm your pin:" : "Set a six-digit passcode:"; // Could think of a converter to switch the sentence view side


        public MainPageViewModel(INavigationService navigationService, IKeyManager keyManager, IDialogServiceEx dialogService)
        {
            _navigationService = navigationService;
            _keyManager        = keyManager;
            TryLoginCommand    = new RelayCommand(TryLogin, IsPasswordValid);
            _dialogService     = dialogService;
        }
예제 #9
0
 public RoleManager(IRoleData roleData, IStringLocalizer <RoleManager> localizer, ILogger <RoleManager> logger, IKeyManager keyManager)
 {
     _roleData   = roleData;
     _localizer  = localizer;
     _logger     = logger;
     _keyManager = keyManager;
 }
예제 #10
0
 public AppEnvironment(IKeyManager keyManager, IServiceManager serviceManager, IRoleManager roleManager, IApiManager apiManager, IStringLocalizer <IAppEnvironment> stringLocalizer)
 {
     _keyManager      = keyManager;
     _serviceManager  = serviceManager;
     _roleManager     = roleManager;
     _apiManager      = apiManager;
     _stringLocalizer = stringLocalizer;
 }
예제 #11
0
 public static VirtualKeyManager <TEnum> Get <TEnum>()
 {
     if (manager == null)
     {
         manager = new VirtualKeyManager <TEnum>();
     }
     return((VirtualKeyManager <TEnum>)manager);
 }
        private OptionsPanel(IKeyManager keyManager)
        {
            InitializeComponent();

            _keyManager              = keyManager;
            uacIcoPanel.Paint       += OnPaint_ElevatedIconPanel;
            keyCreateIcoPanel.Paint += OnPaint_KeyCreateIconPanel;
        }
예제 #13
0
 public void Load()
 {
     LiteratureItems = new ObservableCollection <Library.DBObject.Literature>(IKeyManager.GetLiteratureEnumeratorForKey(Key.id).OrderBy(n => n.position));
     if (LiteratureItems.Count > 0)
     {
         SelectedLiterature = LiteratureItems[0];
     }
 }
예제 #14
0
 /// <summary>
 /// KeyStoreProvider constructor
 /// </summary>
 public KeyStoreProviderProxy()
 {
     try
     {
         keyManager = new KeyManager(null);
     }
     catch (Exception ex) { ExceptionHandler.HandleException(ex); }
 }
예제 #15
0
 public ApiKeyValidator(KeySecretValidator keySecretValidator, IStringLocalizer <ApiKeyValidator> localizer, ILogger <ApiKeyValidator> logger, IApiManager apiManager, IKeyManager keyManager, IServiceManager serviceManager)
 {
     _keySecretValidator = keySecretValidator;
     _localizer          = localizer;
     _logger             = logger;
     _apiManager         = apiManager;
     _keyManager         = keyManager;
     _serviceManager     = serviceManager;
 }
예제 #16
0
 public ApiManager(IApiData apiData, IStringLocalizer <IApiManager> localizer, ILogger <IApiManager> logger,
                   IKeyManager keyManager, IRoleData roleData)
 {
     _apiData    = apiData;
     _localizer  = localizer;
     _logger     = logger;
     _keyManager = keyManager;
     _roleData   = roleData;
 }
예제 #17
0
 public KeyRingProvider(IKeyManager keyManager, KeyManagementOptions keyManagementOptions, IServiceProvider services)
 {
     _keyManagementOptions     = new KeyManagementOptions(keyManagementOptions); // clone so new instance is immutable
     _keyManager               = keyManager;
     _cacheableKeyRingProvider = services?.GetService <ICacheableKeyRingProvider>() ?? this;
     _logger             = services?.GetLogger <KeyRingProvider>();
     _defaultKeyResolver = services?.GetService <IDefaultKeyResolver>()
                           ?? new DefaultKeyResolver(_keyManagementOptions.KeyPropagationWindow, _keyManagementOptions.MaxServerClockSkew, services);
 }
예제 #18
0
 public ShareManager(int treshold, HsmFactory hsmFactory, IKeyManager keyManager, ICentralDbRepository centralDbRepository,
                     List <IPublicShareHolder> publicShareHolders)
 {
     ShareHolders             = publicShareHolders;
     Treshold                 = treshold;
     this.hsmFactory          = hsmFactory;
     this.keyManager          = keyManager;
     this.centralDbRepository = centralDbRepository;
 }
예제 #19
0
 public KeyRingProvider(IKeyManager keyManager, KeyManagementOptions keyManagementOptions, IServiceProvider services)
 {
     _keyManagementOptions = new KeyManagementOptions(keyManagementOptions); // clone so new instance is immutable
     _keyManager = keyManager;
     _cacheableKeyRingProvider = services?.GetService<ICacheableKeyRingProvider>() ?? this;
     _logger = services?.GetLogger<KeyRingProvider>();
     _defaultKeyResolver = services?.GetService<IDefaultKeyResolver>()
         ?? new DefaultKeyResolver(_keyManagementOptions.KeyPropagationWindow, _keyManagementOptions.MaxServerClockSkew, services);
 }
예제 #20
0
 /// <summary>
 /// Constructor
 /// </summary>
 public EncryptHttpClientHandler(
     IKeyManager keyManager,
     IMemoryCache memoryCache,
     ILogger <EncryptHttpClientHandler> logger)
 {
     this.keyManager  = keyManager;
     this.memoryCache = memoryCache;
     this.logger      = logger;
 }
예제 #21
0
        public MainViewModel(INavigationService navigationService, IKeyManager keyManager, IDialogService dialogService)
        {
            _navigationService = navigationService;
            _dialogService     = dialogService;
            _keyManager        = keyManager;

            //Check is pin already setup
            CheckPin();
        }
예제 #22
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="keyManager">Key Manager</param>
 /// <param name="memoryCache">MemoryCache</param>
 /// <param name="logger"></param>
 public PollyRetryPolicyHandler(
     IKeyManager keyManager,
     IMemoryCache memoryCache,
     ILogger <PollyRetryPolicyHandler> logger)
 {
     this.keyManager  = keyManager;
     this.memoryCache = memoryCache;
     this.logger      = logger;
 }
예제 #23
0
        private static ICacheableKeyRingProvider CreateKeyRingProvider(IKeyManager keyManager, IDefaultKeyResolver defaultKeyResolver, KeyManagementOptions keyManagementOptions = null)
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton <IDefaultKeyResolver>(defaultKeyResolver);
            return(new KeyRingProvider(
                       keyManager: keyManager,
                       keyManagementOptions: keyManagementOptions,
                       services: serviceCollection.BuildServiceProvider()));
        }
예제 #24
0
        public ContextBuilder(Configuration config)
        {
            _config      = config;
            _redisConfig = _config.GetRedisSettings();

            _clientsPool  = new ObjectClientsPool(_redisConfig);
            _keys         = new KeyManager(_config);
            _proxyGen     = new ProxyGenerator();
            _implSelector = new ImplBuilder(_config);
        }
예제 #25
0
        public Context(Configuration config, ObjectClient client,
                       IKeyManager keyMgr, IImplBuilder implSelector, ProxyGenerator proxyGen)
        {
            Config = config;
            Client = client;

            Keys            = keyMgr;
            Implementations = implSelector;
            Proxies         = proxyGen;
        }
예제 #26
0
 public KeySecretValidator(IKeyManager keyManager,
                           IStringLocalizer <KeySecretValidator> localizer,
                           ILogger <KeySecretValidator> logger,
                           KeySecretCache keySecretCache)
 {
     _keyManager     = keyManager;
     _localizer      = localizer;
     _logger         = logger;
     _keySecretCache = keySecretCache;
 }
예제 #27
0
 public void Save()
 {
     Key.name        = Name;
     Key.title       = Title;
     Key.description = Description;
     Key.notes       = Notes;
     Key.copyright   = Copyright;
     Key.Publish     = Publish;
     IKeyManager.Update(Key);
 }
예제 #28
0
 public RestrictedController(
     IDataProtectionProvider protector,
     IOptionsMonitor <CookieAuthenticationOptions> options,
     IHttpContextAccessor httpContextAccessor,
     IKeyManager keyManager)
 {
     _protector           = protector;
     _opts                = options.Get("DemoProtectApplication.Cookies");
     _httpContextAccessor = httpContextAccessor;
     _keyManager          = keyManager;
 }
예제 #29
0
 public KeyRingProvider(
     IKeyManager keyManager,
     IOptions <KeyRotationOptions> keyManagementOptions, // options change from original KeyManagementOptions
     IDefaultKeyResolver defaultKeyResolver)
     : this(
         keyManager,
         keyManagementOptions,
         defaultKeyResolver,
         NullLoggerFactory.Instance)
 {
 }
예제 #30
0
 public KeyRingProvider(
     IKeyManager keyManager,
     IOptions <KeyManagementOptions> keyManagementOptions,
     IDefaultKeyResolver defaultKeyResolver)
     : this(
         keyManager,
         keyManagementOptions,
         defaultKeyResolver,
         NullLoggerFactory.Instance)
 {
 }
        public DefaultDataProtectionProvider(
            [NotNull] IOptions <DataProtectionOptions> optionsAccessor,
            [NotNull] IKeyManager keyManager)
        {
            KeyRingBasedDataProtectionProvider rootProvider = new KeyRingBasedDataProtectionProvider(new KeyRingProvider(keyManager));
            var options = optionsAccessor.Options;

            _innerProvider = (!String.IsNullOrEmpty(options.ApplicationDiscriminator))
                ? (IDataProtectionProvider)rootProvider.CreateProtector(options.ApplicationDiscriminator)
                : rootProvider;
        }
예제 #32
0
 public ServiceManager(IServiceData serviceData, IStringLocalizer <IServiceManager> localizer, ILogger <IServiceManager> logger,
                       IKeyManager keyManager, IRoleManager roleManager, IApiManager apiManager
                       )
 {
     _serviceData = serviceData;
     _localizer   = localizer;
     _logger      = logger;
     _keyManager  = keyManager;
     _roleManager = roleManager;
     _apiManager  = apiManager;
 }
        public HomeController(IKeyManager keyManager, IConfiguration configuration, ILoggerFactory loggerFactory)
        {
            _keyring = new AzureKeyVaultKeyRingRepository(
                keyRingName: configuration["DataProtection:KeyRingName"],
                vaultUrl: configuration["Vault:Url"],
                clientId: configuration["Vault:ClientId"],
                tenantId: configuration["Vault:TenantId"],
                secret: configuration["Vault:Secret"],
                loggerFactory: loggerFactory);

            _keyManager = keyManager;
        }
 private static ICacheableKeyRingProvider CreateKeyRingProvider(IKeyManager keyManager, IDefaultKeyResolver defaultKeyResolver, KeyManagementOptions keyManagementOptions= null)
 {
     var serviceCollection = new ServiceCollection();
     serviceCollection.AddInstance<IDefaultKeyResolver>(defaultKeyResolver);
     return new KeyRingProvider(
         keyManager: keyManager,
         keyManagementOptions: keyManagementOptions,
         services: serviceCollection.BuildServiceProvider());
 }
예제 #35
0
 public KeyStoreProviderProxy(IKeyManager keyManager)
 {
     try
     {
         this.keyManager = keyManager;
     }
     catch (Exception ex) { ExceptionHandler.HandleException(ex); }
 }