/// <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); }
/// <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)); }
private AESHelper(IAESConfig config) : this(config.AesPassword, config.AesRGBSalt, config.AesIterations, config.AesIV, config.AesKeyLength) { }
/// <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; }
/// <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); }