38#if defined(MAC_OS_X_VERSION_10_7)
39#include <CommonCrypto/CommonHMAC.h>
40#define SHA_DIGEST_LENGTH 20
42#include <openssl/sha.h>
43#include <openssl/hmac.h>
44#include <openssl/evp.h>
45#include <openssl/bio.h>
46#include <openssl/buffer.h>
58 : fAuthType(kNoAuth), fHost(
"NoHost")
117 toSign +=
"x-goog-api-version:1\n";
128 unsigned char digest[SHA_DIGEST_LENGTH] = {0};
129#if defined(MAC_OS_X_VERSION_10_7)
132 unsigned int *sd = NULL;
160 time_t now = time(NULL);
163 struct tm dateFormat;
164 strftime(result,
sizeof(result),
"%a, %d %b %Y %H:%M:%S GMT",
165 gmtime_r(&now, &dateFormat));
167 strftime(result,
sizeof(result),
"%a, %d %b %Y %H:%M:%S GMT",
196 return "Host: " +
fHost;
231 default:
return "AWS";
263 if (!tokenHeader.
IsNull())
264 request += tokenHeader +
"\r\n";
267 request += authHeader +
"\r\n";
static TString Encode(const char *data)
Transform data into a null terminated base64 string.
Mother of all ROOT objects.
TString GetRequest(TS3HTTPRequest::EHTTPVerb httpVerb, Bool_t appendCRLF=kTRUE)
Returns the HTTP request ready to be sent to the server.
TString HTTPVerbToTString(EHTTPVerb httpVerb) const
TString MakeAuthPrefix() const
Returns the authentication prefix.
TString MakeTokenHeader() const
Returns the session security token header for this HTTP request.
TS3HTTPRequest & SetTimeStamp()
Sets this request's time stamp according to: http://code.google.com/apis/storage/docs/reference-heade...
TString ComputeSignature(TS3HTTPRequest::EHTTPVerb httpVerb) const
Returns this request's signature.
TString MakeRequestLine(TS3HTTPRequest::EHTTPVerb httpVerb) const
Returns the first line of a HTTP request for this object.
TString MakeAuthHeader(TS3HTTPRequest::EHTTPVerb httpVerb) const
Returns the authentication header for this HTTP request.
TString MakeHostHeader() const
Returns the 'Host' header to include in the HTTP request.
TString MakeDateHeader() const
Returns the date header for this HTTP request.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.