示例#1
0
        /// <summary>
        /// Initializes a new instance of the AxCryptHMACSHA1 class
        /// with a provided key.
        /// </summary>
        /// <param name="key">The key</param>
        public static HMAC Create(AesKey key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            AxCryptHMACSHA1 hmac = new AxCryptHMACSHA1();
            hmac.BlockSizeValue = 20;
            hmac.Key = key.GetBytes();

            return hmac;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the AxCryptHMACSHA1 class
        /// with a provided key.
        /// </summary>
        /// <param name="key">The key</param>
        public static HMAC Create(AesKey key)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            AxCryptHMACSHA1 hmac = new AxCryptHMACSHA1();

            hmac.BlockSizeValue = 20;
            hmac.Key            = key.GetBytes();

            return(hmac);
        }