Exemplo n.º 1
0
        /// <summary>
        /// Load security-config.xml
        /// </summary>
        protected void LoadConfiguration()
        {
            try
            {               // FileStream to read the XML document.
                byte[] configFileRawData = GetConfigFileBinaryData();
                if (configFileRawData != null)
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(SecurityConfig));
                    securityConfig = (SecurityConfig)serializer.Deserialize(new MemoryStream(configFileRawData));
                }
            }
            catch (Exception e)
            {
                //if(!(e is FileNotFoundException))
                SystemLogger.Log(SystemLogger.Module.CORE, "Error when loading services configuration", e);
                securityConfig = new SecurityConfig();                 // reset services config mapping when the services could not be loaded for any reason
            }

            SystemLogger.Log(SystemLogger.Module.CORE, "# Security config passcode protected keys #" + securityConfig.ProtectedKeys.Count);
        }
Exemplo n.º 2
0
		/// <summary>
		/// Load security-config.xml
		/// </summary>
		protected void LoadConfiguration()
		{
            securityConfig = new SecurityConfig(); // reset services config mapping when the services could not be loaded for any reason

			try
			{   // FileStream to read the XML document.
				byte[] configFileRawData = GetConfigFileBinaryData();
				if (configFileRawData != null)
				{
					XmlSerializer serializer = new XmlSerializer(typeof(SecurityConfig));
					securityConfig = (SecurityConfig)serializer.Deserialize(new MemoryStream(configFileRawData));
				}
			}
			catch (Exception e)
			{
				//if(!(e is FileNotFoundException))
					SystemLogger.Log(SystemLogger.Module.CORE, "Error when loading security configuration", e);
			}

			SystemLogger.Log (SystemLogger.Module.CORE, "# Security config passcode protected keys #" + securityConfig.ProtectedKeys.Count);
		}