Exemplo n.º 1
0
        public static string ComputeMac(RequestContext requestContext, NephosUriComponents uriComponents, byte[] key)
        {
            string str;
            HMAC   hMAC = HMACCryptoCache.Instance.Acquire(key);

            try
            {
                str = MessageHashFunctions.ComputeMacWithSpecificAlgorithm(hMAC, requestContext, uriComponents);
            }
            finally
            {
                HMACCryptoCache.Instance.Release(hMAC);
            }
            return(str);
        }
Exemplo n.º 2
0
        public static string ComputeMac(string canonicalizedString, byte[] key)
        {
            string str;
            HMAC   hMAC = HMACCryptoCache.Instance.Acquire(key);

            try
            {
                str = MessageHashFunctions.ComputeMacWithSpecificAlgorithm(hMAC, canonicalizedString);
            }
            finally
            {
                HMACCryptoCache.Instance.Release(hMAC);
            }
            return(str);
        }
Exemplo n.º 3
0
        public static string ComputeMac(HttpWebRequest request, NephosUriComponents uriComponents, byte[] key)
        {
            string str;
            string str1 = MessageCanonicalizer.CanonicalizeHttpRequest(request, uriComponents);
            HMAC   hMAC = HMACCryptoCache.Instance.Acquire(key);

            try
            {
                str = MessageHashFunctions.ComputeMacWithSpecificAlgorithm(hMAC, str1);
            }
            finally
            {
                HMACCryptoCache.Instance.Release(hMAC);
            }
            return(str);
        }
Exemplo n.º 4
0
        public static string ComputeMacWithSpecificAlgorithm(HMAC algorithm, RequestContext requestContext, NephosUriComponents uriComponents)
        {
            string str = MessageCanonicalizer.CanonicalizeHttpRequest(requestContext, uriComponents, false);

            return(MessageHashFunctions.ComputeMacWithSpecificAlgorithm(algorithm, str));
        }