示例#1
0
        /// <summary>
        ///     Возвращает хэш.
        /// </summary>
        /// <returns>Значение хэша.</returns>
        public byte[] GetValue()
        {
            int dataLenth = 0;

            if (!CryptoApi.CryptGetHashParam(Handler, Constants.HpHashValue, null, ref dataLenth, 0))
            {
                throw new Win32Exception();
            }
            if (dataLenth == 0)
            {
                throw new Win32Exception();
            }
            var result = new byte[dataLenth];

            if (!CryptoApi.CryptGetHashParam(Handler, Constants.HpHashValue, result, ref dataLenth, 0))
            {
                throw new Win32Exception();
            }
            return(result);
        }