public loginController(IUserRepository userRepo, IModelTokenGenerator <Mdls.User> tokenG, IDecryptProvider decryptProvider, IJwtSecurityProvider tokenp) { userRepository = userRepo; tokenGenerator = tokenG; decryptionProvider = decryptProvider; tokenProvider = tokenp; }
public TokenEncryptionProvider( IOptions <AuthConfig> config, IDecryptProvider decryptionService, IJwtSecurityProvider jwtProvider ) : base(config.Value.tokenKey, decryptionService) { jwtSecurityProvider = jwtProvider; }
public UserController(IUserRepository userRepo, IAuthtenticationCurrentContext currentAuthContext, IMapper autoMapper, IEncryptionKeyGeneratorProvider encryptionP, IDecryptProvider decryptProvider, IAmazonS3ImageProvider amazons3imageprovider) { userRepository = userRepo; authenticationCurrentContext = currentAuthContext; mapper = autoMapper; encryptionProvider = encryptionP; decryptionProvider = decryptProvider; amazonS3ImageProvider = amazons3imageprovider; }
private DbContextData CreateDbContextData(string connectionName = "Default", string databaseName = null) { DbContextData data = new DbContextData(); ConnectionName = connectionName; ConnectionStringSettings setting = ConfigurationManager.ConnectionStrings[connectionName]; if (setting == null) { throw new Exception(string.Format("名为:{0}的节点不存在!", connectionName)); } IDecryptProvider decryptProvider = null; string strDecryptProvider = ConfigurationManager.AppSettings["Dapper.Extensions.DecryptProvider"]; if (!string.IsNullOrWhiteSpace(strDecryptProvider)) { Type encryptProviderType = Type.GetType(strDecryptProvider, true); decryptProvider = (IDecryptProvider)Activator.CreateInstance(encryptProviderType); } string connectionString = setting.ConnectionString; if (decryptProvider != null) { connectionString = decryptProvider.Decrypt(setting.ConnectionString); } if (!string.IsNullOrWhiteSpace(databaseName)) { connectionString = string.Format(connectionString, databaseName); } Type dbConnectionType = Type.GetType(setting.ProviderName, true); IDbProvider dbProvider = (IDbProvider)Activator.CreateInstance(dbConnectionType); DbProviderFactory dbProviderFactory = DbProviderFactories.GetFactory(dbProvider.ProviderName); data.ConnectionString = connectionString; data.DbProvider = dbProvider; data.DbProviderFactory = dbProviderFactory; return(data); }
public EncryptionKeyGeneratorProvider(IDecryptProvider decryptionService) : base(Helpers.KeyGenerator.NewKey, decryptionService) { }
public EncryptionProvider(string key, IDecryptProvider decryptProvider) { encryptionKey = key; decryptionService = decryptProvider; }