public static string GenerateKeyAuthorizationSignature(string verb,
                                                               string resourceId,
                                                               string resourceType,
                                                               INameValueCollection headers,
                                                               IComputeHash stringHMACSHA256Helper,
                                                               out ArrayOwner payload)
        {
            string authorizationToken = AuthorizationHelper.GenerateAuthorizationTokenWithHashCore(
                verb,
                resourceId,
                resourceType,
                headers,
                stringHMACSHA256Helper,
                out payload);

            try
            {
                return(HttpUtility.UrlEncode(string.Format(CultureInfo.InvariantCulture, Constants.Properties.AuthorizationFormat,
                                                           Constants.Properties.MasterToken,
                                                           Constants.Properties.TokenVersion,
                                                           authorizationToken)));
            }
            catch
            {
                payload.Dispose();
                throw;
            }
        }
예제 #2
0
        public static string GenerateKeyAuthorizationSignature(string verb,
                                                               string resourceId,
                                                               string resourceType,
                                                               INameValueCollection headers,
                                                               IComputeHash stringHMACSHA256Helper,
                                                               out ArrayOwner payload)
        {
            string authorizationToken = AuthorizationHelper.GenerateUrlEncodedAuthorizationTokenWithHashCore(
                verb: verb,
                resourceId: resourceId,
                resourceType: resourceType,
                headers: headers,
                stringHMACSHA256Helper: stringHMACSHA256Helper,
                payload: out payload);

            try
            {
                return(AuthorizationHelper.AuthorizationFormatPrefixUrlEncoded + authorizationToken);
            }
            catch
            {
                payload.Dispose();
                throw;
            }
        }