Updated on 2022-09-06 GMT+08:00

Creating a To-Be-Signed String

After a standard HTTP request is constructed and the request hash value is obtained, create a to-be-signed string by combining them with the signature algorithm and signing time.
StringToSign =
    Algorithm + \n +
    RequestDateTime + \n +
    HashedCanonicalRequest

Parameters in the pseudocode are described as follows:

  • Algorithm

    Signature algorithm. For SHA-256, the value is SDK-HMAC-SHA256.

  • RequestDateTime

    Request timestamp, which is the same as X-Sdk-Date in the request header. The format is YYYYMMDDTHHMMSSZ.

  • HashedCanonicalRequest

    Hash value generated using the SHA-256 algorithm based on the standard request constructed in Constructing a Standard Request.

In this example, the following to-be-signed string is obtained:
SDK-HMAC-SHA256
20191115T033655Z
b25362e603ee30f4f25e7858e8a7160fd36e803bb2dfe206278659d71a9bcd7a