using System.Configuration; namespace Neo.Afx.Security { /// /// Represents the RSA settings configuration section. /// public class RsaSettings : ConfigurationSection { readonly ConfigurationProperty _key = new ConfigurationProperty("key", typeof(string), null, ConfigurationPropertyOptions.IsRequired); /// /// Gets the RSA settings configuration section. /// /// Expects the section to be named rsaSettings. /// /// /// The RSA settings configuration section. public static RsaSettings GetSection() { return ConfigurationManager.GetSection("rsaSettings") as RsaSettings; } #region Key /// /// Gets or sets the key. /// [ConfigurationProperty("key", IsRequired = true)] public string Key { get { return (string)base[_key]; } set { base[_key] = value; } } #endregion } ///// ///// Represents the RSA private key settings. ///// //public class RsaSettings : ConfigurationElement //{ // readonly ConfigurationProperty _modulus = new ConfigurationProperty("Modulus", typeof(string), null, ConfigurationPropertyOptions.IsRequired); // readonly ConfigurationProperty _exponent = new ConfigurationProperty("Exponent", typeof(string), null, ConfigurationPropertyOptions.IsRequired); // readonly ConfigurationProperty _p = new ConfigurationProperty("P", typeof(string), null, ConfigurationPropertyOptions.None); // readonly ConfigurationProperty _q = new ConfigurationProperty("Q", typeof(string), null, ConfigurationPropertyOptions.None); // readonly ConfigurationProperty _dp = new ConfigurationProperty("DP", typeof(string), null, ConfigurationPropertyOptions.None); // readonly ConfigurationProperty _dq = new ConfigurationProperty("DQ", typeof(string), null, ConfigurationPropertyOptions.None); // readonly ConfigurationProperty _inverseQ = new ConfigurationProperty("InverseQ", typeof(string), null, ConfigurationPropertyOptions.None); // readonly ConfigurationProperty _d = new ConfigurationProperty("D", typeof(string), null, ConfigurationPropertyOptions.None); // ConfigurationPropertyCollection _properties = new ConfigurationPropertyCollection(); // public RsaSettings() // { // } // #region Modulus // /// // /// Gets or sets the modulus. // /// // [ConfigurationProperty("Modulus", IsRequired = true)] // public string Modulus // { // get // { // return (string)base[_modulus]; // } // set // { // base[_modulus] = value; // } // } // #endregion //} }