Esempio n. 1
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;
            }
        }
Esempio n. 2
0
        public static string GenerateKeyAuthorizationSignature(string verb,
                                                               string resourceId,
                                                               string resourceType,
                                                               INameValueCollection headers,
                                                               IComputeHash stringHMACSHA256Helper)
        {
            string authorizationToken = AuthorizationHelper.GenerateUrlEncodedAuthorizationTokenWithHashCore(
                verb,
                resourceId,
                resourceType,
                headers,
                stringHMACSHA256Helper,
                out ArrayOwner payloadStream);

            using (payloadStream)
            {
                return(AuthorizationHelper.AuthorizationFormatPrefixUrlEncoded + authorizationToken);
            }
        }