using System; using System.Collections.Generic; using System.Text; using System.Configuration; using SuperSocket.SocketBase.Config; using System.Security.Cryptography.X509Certificates; namespace SuperSocket.SocketEngine.Configuration { /// /// Certificate configuration /// public class CertificateConfig : ConfigurationElement, ICertificateConfig { #region ICertificateConfig Members /// /// Gets the certificate file path. /// [ConfigurationProperty("filePath", IsRequired = false)] public string FilePath { get { return this["filePath"] as string; } } /// /// Gets the password. /// [ConfigurationProperty("password", IsRequired = false)] public string Password { get { return this["password"] as string; } } /// /// Gets the the store where certificate locates. /// /// /// The name of the store. /// [ConfigurationProperty("storeName", IsRequired = false)] public string StoreName { get { return this["storeName"] as string; } } /// /// Gets the store location of the certificate. /// /// /// The store location. /// [ConfigurationProperty("storeLocation", IsRequired = false, DefaultValue = "CurrentUser")] public StoreLocation StoreLocation { get { return (StoreLocation)this["storeLocation"]; } } /// /// Gets the thumbprint. /// [ConfigurationProperty("thumbprint", IsRequired = false)] public string Thumbprint { get { return this["thumbprint"] as string; } } /// /// Gets a value indicating whether [client certificate required]. /// /// /// true if [client certificate required]; otherwise, false. /// [ConfigurationProperty("clientCertificateRequired", IsRequired = false, DefaultValue = false)] public bool ClientCertificateRequired { get { return (bool)this["clientCertificateRequired"]; } } /// /// Gets a value that will be used to instantiate the X509Certificate2 object in the CertificateManager /// [ConfigurationProperty("keyStorageFlags", IsRequired = false, DefaultValue = X509KeyStorageFlags.DefaultKeySet)] public X509KeyStorageFlags KeyStorageFlags { get { return (X509KeyStorageFlags)this["keyStorageFlags"]; } } #endregion ICertificateConfig Members } }