object GetDefaultValue(ISettingDescriptor setting)
        {
            var value = setting.DefaultValue ?? ConvertValue(null, setting);

            if (setting.IsProtected && value != null)
            {
                value = ProtectedDataUtils.Encrypt((string)value, _secretKey ?? typeof(SettingDescriptor).FullName);
            }

            return(value);
        }
Esempio n. 2
0
        protected virtual object Decrypt(object value)
        {
            var str = value as string;

            return(String.IsNullOrEmpty(str) ? value : ProtectedDataUtils.Decrypt(str, secretKey));
        }