C# Class Dev2.Runtime.Security.HostSecureConfig

The Secure Config
Inheritance: ISecureConfig
显示文件 Open project: Warewolf-ESB/Warewolf

Public Methods

Method Description
CreateKey ( string base64String ) : RSACryptoServiceProvider

Creates the RSACryptoServiceProvider from the given base64 encoded key.

CreateSettings ( string serverID, string serverKey, string systemKey ) : NameValueCollection

Creates the a NameValueCollection configuration settings.

HostSecureConfig ( ) : System
HostSecureConfig ( NameValueCollection settings, bool shouldProtectConfig = true ) : System

Protected Methods

Method Description
Initialize ( NameValueCollection settings, bool shouldProtectConfig ) : void

Initializes config with the given values and optionally protects it. If shouldProtectConfig is true, then the config file must exist on disk.

ProtectConfig ( ) : void

Protects the configuration using the RsaProtectedConfigurationProvider.

SaveConfig ( NameValueCollection secureSettings ) : void

Saves the given secure settings into XML configuration file called FileName.

Private Methods

Method Description
EnsureSecureConfigFileExists ( ) : void

Method Details

CreateKey() public static method

Creates the RSACryptoServiceProvider from the given base64 encoded key.
public static CreateKey ( string base64String ) : RSACryptoServiceProvider
base64String string The base64 encoded key.
return System.Security.Cryptography.RSACryptoServiceProvider

CreateSettings() public static method

Creates the a NameValueCollection configuration settings.
public static CreateSettings ( string serverID, string serverKey, string systemKey ) : NameValueCollection
serverID string The server ID.
serverKey string The server key.
systemKey string The system key.
return System.Collections.Specialized.NameValueCollection

HostSecureConfig() public method

public HostSecureConfig ( ) : System
return System

HostSecureConfig() public method

public HostSecureConfig ( NameValueCollection settings, bool shouldProtectConfig = true ) : System
settings System.Collections.Specialized.NameValueCollection
shouldProtectConfig bool
return System

Initialize() protected method

Initializes config with the given values and optionally protects it. If shouldProtectConfig is true, then the config file must exist on disk.
settings
protected Initialize ( NameValueCollection settings, bool shouldProtectConfig ) : void
settings System.Collections.Specialized.NameValueCollection The settings to be loaded.
shouldProtectConfig bool true if the configuration should be protected; false otherwise.
return void

ProtectConfig() protected method

Protects the configuration using the RsaProtectedConfigurationProvider.
protected ProtectConfig ( ) : void
return void

SaveConfig() protected method

Saves the given secure settings into XML configuration file called FileName.
protected SaveConfig ( NameValueCollection secureSettings ) : void
secureSettings System.Collections.Specialized.NameValueCollection The settings to be saved.
return void