Esempio n. 1
0
        public void SetPassword(string password, IEncrypter encrypter)
        {
            if (string.IsNullOrWhiteSpace(password))
            {
                //TODO: Validate password power?
                throw new SmartFridgeException("empty_password", "Password cant be empty.");
            }

            Salt     = encrypter.CreateSalt(8);
            Password = encrypter.GenerateSaltedHash(Encoding.UTF8.GetBytes(password), Encoding.UTF8.GetBytes(Salt));
        }