Esempio n. 1
0
        /// <summary>
        /// Encrypts the protected fields.
        /// </summary>
        /// <param name="crypto">The crypto random stream.</param>
        public void Encrypt(CryptoRandomStream crypto)
        {
            if (crypto == null)
            {
                throw new ArgumentNullException("crypto");
            }

            var values = GetProtectedValues();

            foreach (var item in values)
            {
                item.Value = crypto
                             .Encrypt(item.Value);
            }
        }