The response signature is contained in Authorization of the HTTP header, indicating the response is authorized.
The values separated by the colon are the AccessKeyID (left) and signature (right). The verification code is calculated as follows.
"Authorization: OTS " + AccessID + ":" + base64(hmac-sha1(
+ CONTENT-MD5 + "\n"
+ CONTENT-TYPE + "\n"
As shown in the preceding code, the headers of a Table Store response signature include
CanonicalizedOTSHeaders (canonicalized Table Store header), and
CanonicalizedResource (canonicalized Table Store resource address).
Content-MD5 are required. A carriage return must be added after each header, with the exception of if CanonicalizedOTSHeaders does not exist. A canonicalized Table Store header is a header prefixed with
The signature of CanonicalizedOTSHeaders must observe the following rules:
Headers are in lowercase.
The headers are sorted in ascending lexicographic order by name.
There cannot be a space before or after the colon that separates the header name and value.
A newline character
\nmust be used to separate headers.
If CanonicalizedOTSHeaders does not exist, the parameter can remain blank.
The current version has a unique CanonicalizedOTSHeaders, which is
x-ots-date. It indicates the time that Table Store returns the response. The format is
%a, %d %b %Y %H:%M:%S GMT, for example, Mon, 3 Jan 2010 08:33:47 GMT.
You can calculate the signature in the same way, and check whether the response is valid by comparing the calculated signature and the one provided by Table Store in terms of consistency.