Esempio n. 1
0
 /// <summary>
 /// Create a AESHelper by interface
 /// </summary>
 /// <param name="cfg">Config</param>
 public static AESHelper Create(IAESConfig cfg)
 {
     if (IsConfigured(cfg))
     {
         return(new AESHelper(cfg));
     }
     return(null);
 }
Esempio n. 2
0
 /// <summary>
 /// Check if its OK
 /// </summary>
 /// <param name="cfg">Config</param>
 public static bool IsConfigured(IAESConfig cfg)
 {
     if (cfg == null)
     {
         return(false);
     }
     return(!string.IsNullOrEmpty(cfg.AesPassword) && !string.IsNullOrEmpty(cfg.AesIV) && !string.IsNullOrEmpty(cfg.AesRGBSalt));
 }
Esempio n. 3
0
 private AESHelper(IAESConfig config) : this(config.AesPassword, config.AesRGBSalt, config.AesIterations, config.AesIV, config.AesKeyLength)
 {
 }
Esempio n. 4
0
 private AESHelper(IAESConfig config) : this(config.AesPassword, config.AesRGBSalt, config.AesIterations, config.AesIV, config.AesKeyLength) { }
Esempio n. 5
0
 /// <summary>
 /// Create a AESHelper by interface
 /// </summary>
 /// <param name="cfg">Config</param>
 public static AESHelper Create(IAESConfig cfg)
 {
     if (IsConfigured(cfg)) return new AESHelper(cfg);
     return null;
 }
Esempio n. 6
0
 /// <summary>
 /// Check if its OK
 /// </summary>
 /// <param name="cfg">Config</param>
 public static bool IsConfigured(IAESConfig cfg)
 {
     if (cfg == null) return false;
     return !string.IsNullOrEmpty(cfg.AesPassword) && !string.IsNullOrEmpty(cfg.AesIV) && !string.IsNullOrEmpty(cfg.AesRGBSalt);
 }