Example #1
0
        public void GenerateDefaultParametersIfNotConfigured()
        {
            // if not configured, a random string will be generated as date shift key, others will keep their default values
            if (ParameterConfiguration == null)
            {
                ParameterConfiguration = new ParameterConfiguration
                {
                    DateShiftKey  = Guid.NewGuid().ToString("N"),
                    CryptoHashKey = s_defaultCryptoKey.Value,
                    EncryptKey    = s_defaultCryptoKey.Value
                };
                return;
            }

            if (string.IsNullOrEmpty(ParameterConfiguration.DateShiftKey))
            {
                ParameterConfiguration.DateShiftKey = Guid.NewGuid().ToString("N");
            }

            if (string.IsNullOrEmpty(ParameterConfiguration.CryptoHashKey))
            {
                ParameterConfiguration.CryptoHashKey = s_defaultCryptoKey.Value;
            }

            if (string.IsNullOrEmpty(ParameterConfiguration.EncryptKey))
            {
                ParameterConfiguration.EncryptKey = s_defaultCryptoKey.Value;
            }
        }
 public void GenerateDefaultParametersIfNotConfigured()
 {
     // if not configured, a random string will be generated as date shift key, others will keep their default values
     if (ParameterConfiguration == null)
     {
         ParameterConfiguration = new ParameterConfiguration
         {
             DateShiftKey = Guid.NewGuid().ToString("N")
         };
     }
     else if (string.IsNullOrEmpty(ParameterConfiguration.DateShiftKey))
     {
         ParameterConfiguration.DateShiftKey = Guid.NewGuid().ToString("N");
     }
 }