Beispiel #1
0
        /// <summary>
        /// Decrypts the <paramref name="encrypted"/> to an array of <see cref="decimal"/> values.
        /// </summary>
        /// <param name="cipher">The cipher.</param>
        /// <param name="encrypted">The data to be decrypted.</param>
        /// <returns>The encrypted text.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown when <paramref name="cipher"/> is <see langword="null"/>.</exception>
        public static decimal[] DecryptDecimalArray(
            this ICipher cipher,
            byte[] encrypted)
        {
            if (cipher == null)
            {
                throw new ArgumentNullException(nameof(cipher));
            }

            if (encrypted == null)
            {
                return(null);
            }

            return(FromByteArray.ToDecimalArray(cipher.Decrypt(encrypted)));
        }