Esempio 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);
        }
Esempio 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);
        }
Esempio 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);
        }
Esempio 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));
        }