_usePathStyleUri) { $path = substr($path, strpos($path, '/')); } // Determine query $queryString = $this->_prepareQueryStringForSigning($queryString); // Build canonicalized resource string $canonicalizedResource = '/' . $this->_accountName; if ($this->_usePathStyleUri) { $canonicalizedResource .= '/' . $this->_accountName; } $canonicalizedResource .= $path; if ($queryString !== '') { $canonicalizedResource .= $queryString; } // Request date $requestDate = ''; if (isset($headers[Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'])) { $requestDate = $headers[Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date']; } else { $requestDate = gmdate('D, d M Y H:i:s', time()) . ' GMT'; // RFC 1123 } // Create string to sign $stringToSign = array(); $stringToSign[] = $requestDate; // Date $stringToSign[] = $canonicalizedResource; // Canonicalized resource $stringToSign = implode("\n", $stringToSign); $signString = base64_encode(hash_hmac('sha256', $stringToSign, $this->_accountKey, true)); // Sign request $headers[Zend_Service_WindowsAzure_Credentials_CredentialsAbstract::PREFIX_STORAGE_HEADER . 'date'] = $requestDate; $headers['Authorization'] = 'SharedKeyLite ' . $this->_accountName . ':' . $signString; // Return headers return $headers; } }