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

            _hashHandle.TryDispose();

            _hashHandle = hashHmacHandle;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
        private void InitializeHmac()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _key.InternalKeyHandle, Constants.CALG_GR3411_2012_512_HMAC);

            _hashHmacHandle.TryDispose();

            _hashHmacHandle = hashHmacHandle;
        }
Exemplo n.º 6
0
        private void InitializeHmac()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _key.InternalKeyHandle);

            _hashHmacHandle.TryDispose();

            _hashHmacHandle = hashHmacHandle;
        }
Exemplo n.º 7
0
        public Gost3411Hmac()
        {
            HashName      = DefaultHashName;
            HashSizeValue = DefaultHashSize;

            _keyAlgorithm = new Gost28147SymmetricAlgorithm();
            _hashHandle   = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle);
        }
Exemplo n.º 8
0
        public override void Initialize()
        {
            var hashHmacHandle = CryptoApiHelper.CreateHashHmac(CryptoApiHelper.ProviderHandle, _keyAlgorithm.InternalKeyHandle);

            _hashHandle.TryDispose();

            _hashHandle = hashHmacHandle;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }