/// <summary> /// Initializes a new instance of the <see cref="ProviderFactory"/> /// </summary> /// <param name="factoryName"><para>A friendly name that will be included in exception messages.</para></param> /// <param name="configurationContext"><para>The <see cref="ConfigurationContext"/> to use.</para></param> /// <param name="type"><para>The base type of all providers that this factory will create.</para></param> /// <excpetion cref="ArgumentNullException"> /// <para><paramref name="configurationContext"/> is a <see langword="null"/> reference (Nothing in Visual Basic).</para> /// <para>- or -</para> /// <para><paramref name="factoryName"/> is a <see langword="null"/> reference (Nothing in Visual Basic).</para> /// <para>- or -</para> /// <para><paramref name="type"/> is a <see langword="null"/> reference (Nothing in Visual Basic).</para> /// </excpetion> protected ProviderFactory(string factoryName, ConfigurationContext configurationContext, Type type) : base(factoryName, configurationContext) { ArgumentValidation.CheckForNullReference(type, "type"); this.type = type; }
/// <summary> /// Instantiates a new instance of the /// <see cref="ExceptionPolicyEntry"/> class. /// </summary> internal ExceptionPolicyEntry(string policyName, ExceptionTypeData typeData, ConfigurationContext context) { this.policyName = policyName; this.postHandlingAction = typeData.PostHandlingAction; this.typeDataName = typeData.Name; this.factory = new ExceptionHandlerFactory(context); }
public UserForm(DbAuthenticationProviderData dbAuthenticationProvider, ConfigurationContext context, string username) : this(dbAuthenticationProvider, context) { tbxUser.Text = username; tbxUser.Enabled = false; editMode = true; label3.Text = SR.NewPasswordLabel; }
public RoleForm(DbAuthenticationProviderData dbAuthenticationProviderData, ConfigurationContext context, string role) : this(dbAuthenticationProviderData, context) { tbxRole.Text = role; originalRoleName = role; editMode = true; UpdateSaveButtonEnabled(); }
public RoleForm(DbAuthenticationProviderData dbAuthenticationProviderData, ConfigurationContext context) { this.dbAuthenticationproviderData = dbAuthenticationProviderData; InitializeComponent(); this.userRoleMgr = new UserRoleManager(dbAuthenticationProviderData.Database, context); UpdateSaveButtonEnabled(); }
/// <summary> /// <para>Initializes a new instance of the <see cref="ConfigurationFactory"/> class with the factory name and a <see cref="ConfigurationContext"/>.</para> /// </summary> /// <param name="factoryName"> /// <para>The name of the factory.</para> /// </param> /// <param name="configurationContext"> /// <para>A <see cref="ConfigurationContext"/> object</para> /// </param> protected ConfigurationFactory(string factoryName, ConfigurationContext configurationContext) { ArgumentValidation.CheckForNullReference(configurationContext, "configurationContext"); ArgumentValidation.CheckForNullReference(factoryName, "providerName"); ArgumentValidation.CheckForEmptyString(factoryName, "factoryName"); this.configurationContext = configurationContext; this.factoryName = factoryName; }
public UserForm(DbAuthenticationProviderData dbAuthenticationProvider, ConfigurationContext context) { this.dbAuthenticationProvider = dbAuthenticationProvider; InitializeComponent(); this.userRoleMgr = new UserRoleManager(dbAuthenticationProvider.Database, context); HashProviderFactory hashProviderFactory = new HashProviderFactory(context); this.hashProvider = hashProviderFactory.CreateHashProvider(dbAuthenticationProvider.HashProvider); UpdateSaveButtonEnabled(); }
public MainForm(ConfigurationContext configurationContext) { Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); this.configurationContext = configurationContext; InitializeComponent(); UpdateEditRoleButtonEnabled(); UpdateEditUserButtonEnabled(); UpdateConnectButtonEnabled(); UpdateUserToRoleButtonsEnabled(); }
public static void CreateTestData(ConfigurationContext context) { UserRoleManager urm = new UserRoleManager("EntLibSecurity", context); DeleteTestData(context); byte[] pwd = SHA1Managed.Create().ComputeHash(ASCIIEncoding.ASCII.GetBytes("Password")); byte [] emptyPasswd = SHA1Managed.Create().ComputeHash(ASCIIEncoding.ASCII.GetBytes("")); urm.CreateUser("testuser", pwd); urm.CreateUser("bogususer", pwd); urm.CreateUser("emptyUser", emptyPasswd); urm.CreateRole("Admins"); urm.CreateRole("Managers"); urm.CreateRole("Users"); urm.CreateUserRole("testuser", "Users"); urm.CreateUserRole("testuser", "Managers"); }
public StorageProviderFactory(ConfigurationContext context) : base(SR.StorageProvider, context, typeof(IStorageProviderReader)) { }
/// <summary> /// <para>Initialize a new instance of the <see cref="CachingConfigurationView"/> with a <see cref="ConfigurationContext"/>.</para> /// </summary> /// <param name="configurationContext"> /// <para>A <see cref="ConfigurationContext"/> object.</para> /// </param> public CachingConfigurationView(ConfigurationContext configurationContext) : base(configurationContext) { }
/// <summary> /// Initializes a new instance of <see cref="LogDistributor"></see> /// </summary> /// <param name="configurationContext"><see cref="ConfigurationContext"></see> used to initialize this instance</param> public LogDistributor(ConfigurationContext configurationContext) { this.loggingConfigurationView = new LoggingConfigurationView(configurationContext); this.events = new DistributorEvents(); this.defaulLogSink = new DefaultLogDestination(); }
public void Initialize(ProviderData providerData, ConfigurationContext configurationContext) { }
/// <summary> /// <para>Initialize a new instance of the <see cref="CryptographyConfigurationView"/> class with a <see cref="ConfigurationContext"/> object.</para> /// </summary> /// <param name="configurationContext"> /// <para>A <see cref="ConfigurationContext"/> object.</para> /// </param> public CryptographyConfigurationView(ConfigurationContext configurationContext) : base(configurationContext) { }
/// <summary> /// <para>Initialize a new instance of the <see cref="ConfigurationView"/> with a <see cref="ConfigurationContext"/>.</para> /// </summary> /// <param name="context"> /// <para>A <see cref="ConfigurationContext"/> object.</para> /// </param> protected ConfigurationView(ConfigurationContext context) { ArgumentValidation.CheckForNullReference(context, "context"); this.context = context; }
public TransformerFactory(ConfigurationContext context) : base(SR.Transformer, context, typeof(ITransformer)) { }
/// <summary> /// Set up the queue with the specified logger /// </summary> /// <param name="configurationContext"><see cref="ConfigurationContext"></see> containing current configuration information</param> /// <param name="eventLogger"><see cref="DistributorEventLogger"></see> to use for distributing events from this object</param> public MsmqLogDistributor(ConfigurationContext configurationContext, DistributorEventLogger eventLogger) : base(configurationContext) { this.eventLogger = eventLogger; }
/// <summary> /// <para> /// Initializes a new instance of the <see cref="ExceptionHandlerFactory"/> class with the specified <see cref="ConfigurationContext"/>. /// </para> /// </summary> /// <param name="configurationContext"> /// <para>Configuration context to use when creating factory</para> /// </param> public ExceptionHandlerFactory(ConfigurationContext configurationContext) : base(SR.HandlerFactoryName, configurationContext, typeof(IExceptionHandler)) { this.policyName = string.Empty; this.exceptionTypeName = string.Empty; }
/// <summary> /// Initializes a new instance of the <see cref="LogSinkFactory"/> class. /// </summary> public LogSinkFactory(ConfigurationContext context) : base(SR.SinkFactoryName, context, typeof(ILogSink)) { }
/// <summary> /// Returns the named IRolesProvider instance. Guaranteed to return an initialized IRolesProvider if no exception thrown. /// </summary> /// <param name="rolesProviderName">Name defined in configuration for the Roles provider to instantiate</param> /// <param name="context">The configuration context to use.</param> /// <returns>Named Roles provider instance</returns> /// <exception cref="ArgumentNullException">providerName is null</exception> /// <exception cref="ArgumentException">providerName is empty</exception> /// <exception cref="ConfigurationException">Could not find instance specified in providerName</exception> /// <exception cref="InvalidOperationException">Error processing configuration information defined in application configuration file.</exception> public static IRolesProvider GetRolesProvider(string rolesProviderName, ConfigurationContext context) { RolesProviderFactory factory = new RolesProviderFactory(context); return factory.GetRolesProvider(rolesProviderName); }
public TestLoggingConfigurationView(ConfigurationContext context) : base(context) { }
/// <summary> /// <para>Initialize a new instance of the <see cref="SecurityConfigurationView"/> class with a <see cref="ConfigurationContext"/> object.</para> /// </summary> /// <param name="configurationContext"> /// <para>A <see cref="ConfigurationContext"/> object.</para> /// </param> public SecurityConfigurationView(ConfigurationContext configurationContext) : base(configurationContext) { }
internal static byte[] CreateHash(string hashInstance, byte[] plaintext, ConfigurationContext context) { ArgumentValidation.CheckForNullReference(hashInstance, "hashInstance"); ArgumentValidation.CheckForEmptyString(hashInstance, "hashInstance"); HashProviderFactory factory = new HashProviderFactory(context); IHashProvider hashProvider = factory.CreateHashProvider(hashInstance); return hashProvider.CreateHash(plaintext); }
/// <summary> /// Creates an instance of the factory. /// </summary> /// <param name="context">The current configuration context.</param> public SecurityCacheProviderFactory(ConfigurationContext context) : base(SR.SecurityCache, context, typeof(ISecurityCacheProvider)) { }
internal static string CreateHash(string hashInstance, string plaintext, ConfigurationContext context) { ArgumentValidation.CheckForNullReference(hashInstance, "hashInstance"); ArgumentValidation.CheckForEmptyString(hashInstance, "hashInstance"); byte[] plainTextBytes = UnicodeEncoding.Unicode.GetBytes(plaintext); byte[] resultBytes = CreateHash(hashInstance, plainTextBytes, context); CryptographyUtility.GetRandomBytes(plainTextBytes); return Convert.ToBase64String(resultBytes); }
public TestAuthorizationRuleProviderView(AuthorizationRuleProviderData data, ConfigurationContext context) : base(context) { this.data = data; }
internal static string DecryptSymmetric(string symmetricInstance, string ciphertextBase64, ConfigurationContext context) { ArgumentValidation.CheckForNullReference(symmetricInstance, "symmetricInstance"); ArgumentValidation.CheckForEmptyString(symmetricInstance, "symmetricInstance"); byte[] cipherTextBytes = Convert.FromBase64String(ciphertextBase64); byte[] decryptedBytes = DecryptSymmetric(symmetricInstance, cipherTextBytes, context); string decryptedString = UnicodeEncoding.Unicode.GetString(decryptedBytes); CryptographyUtility.GetRandomBytes(decryptedBytes); return decryptedString; }
public MockAuthenticationProvider(ProviderData providerData, ConfigurationContext context) { }
internal static byte[] EncryptSymmetric(string symmetricInstance, byte[] plaintext, ConfigurationContext context) { ArgumentValidation.CheckForNullReference(symmetricInstance, "symmetricInstance"); ArgumentValidation.CheckForEmptyString(symmetricInstance, "symmetricInstance"); SymmetricCryptoProviderFactory factory = new SymmetricCryptoProviderFactory(context); ISymmetricCryptoProvider symmetricProvider = factory.CreateSymmetricCryptoProvider(symmetricInstance); return symmetricProvider.Encrypt(plaintext); }
/// <summary> /// Initializes a new instance of the <see cref="AuthorizationProviderFactory"/> /// with the specified <see cref="ConfigurationContext"/>. /// </summary> /// <param name="context">A <see cref="ConfigurationContext"/>.</param> public AuthorizationProviderFactory(ConfigurationContext context) : base(SR.Authorization, context, typeof(IAuthorizationProvider)) { }
internal static string EncryptSymmetric(string symmetricInstance, string plaintext, ConfigurationContext context) { ArgumentValidation.CheckForNullReference(symmetricInstance, "symmetricInstance"); ArgumentValidation.CheckForEmptyString(symmetricInstance, "symmetricInstance"); byte[] plainTextBytes = UnicodeEncoding.Unicode.GetBytes(plaintext); byte[] cipherTextBytes = EncryptSymmetric(symmetricInstance, plainTextBytes, context); CryptographyUtility.GetRandomBytes(plainTextBytes); return Convert.ToBase64String(cipherTextBytes); }
/// <summary> /// <para>Initialize a new instance of the <see cref="SymmetricCryptoProviderFactory"/> class with a <see cref="ConfigurationContext"/> object.</para> /// </summary> /// <param name="context">A <see cref="ConfigurationContext"/> object.</param> public SymmetricCryptoProviderFactory(ConfigurationContext context) : base(SR.SymmetricCryptoFactory, context, typeof(ISymmetricCryptoProvider)) { }
/// <summary> /// Setup the queue and the formatter of the messages. /// </summary> public MsmqLogDistributor(ConfigurationContext configurationContext) : this(configurationContext, new DistributorEventLogger()) { }