public override void Initialize()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle, Constants.CALG_GR3411_2012_256_HMAC);

            _hashHandle.TryDispose();

            _hashHandle = hashHmacHandle;
        }
Пример #2
0
        private void InitializeHmac()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _key.InternalKeyHandle, GostCryptoConfig.ProviderType == ProviderTypes.VipNet ? Constants.CALG_GR3411_HMAC34 : Constants.CALG_GR3411_HMAC);

            _hashHmacHandle.TryDispose();

            _hashHmacHandle = hashHmacHandle;
        }
Пример #3
0
        public Gost3411Hmac()
        {
            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = new Gost28147SymmetricAlgorithm();
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle, GostCryptoConfig.ProviderType == ProviderTypes.VipNet ? Constants.CALG_GR3411_HMAC34 : Constants.CALG_GR3411_HMAC);
        }
        public Gost3411_2012_256Hmac()
        {
            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = new Gost28147SymmetricAlgorithm();
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle, Constants.CALG_GR3411_2012_256_HMAC);
        }
Пример #5
0
        private void InitializeHmac()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _key.InternalKeyHandle, Constants.CALG_GR3411_2012_512_HMAC);

            _hashHmacHandle.TryDispose();

            _hashHmacHandle = hashHmacHandle;
        }
Пример #6
0
        private void InitializeHmac()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _key.InternalKeyHandle);

            _hashHmacHandle.TryDispose();

            _hashHmacHandle = hashHmacHandle;
        }
Пример #7
0
        public Gost3411Hmac()
        {
            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = new Gost28147SymmetricAlgorithm();
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle);
        }
Пример #8
0
        public override void Initialize()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle);

            _hashHandle.TryDispose();

            _hashHandle = hashHmacHandle;
        }
Пример #9
0
        public Gost3411Hmac(Gost28147 keyAlgorithm)
        {
            if (keyAlgorithm == null)
            {
                throw ExceptionUtility.ArgumentNull("keyAlgorithm");
            }

            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = DuplicateKeyAlg(keyAlgorithm);
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle, GostCryptoConfig.ProviderType == ProviderTypes.VipNet ? Constants.CALG_GR3411_HMAC34 : Constants.CALG_GR3411_HMAC);
        }
Пример #10
0
        public Gost3411Hmac(Gost28147SymmetricAlgorithmBase keyAlgorithm)
        {
            if (keyAlgorithm == null)
            {
                throw ExceptionUtility.ArgumentNull("keyAlgorithm");
            }

            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = DuplicateKeyAlg(keyAlgorithm);
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle);
        }
        public Gost3411_2012_256Hmac(byte[] key)
        {
            if (key == null)
            {
                throw ExceptionUtility.ArgumentNull("key");
            }

            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = new Gost28147SymmetricAlgorithm {
                Key = key
            };
            _hashHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle, Constants.CALG_GR3411_2012_256_HMAC);
        }