Signature
Table of Contents
Introduction
In this section, we will show you the mechanism of generating parameter sign.
Additionally, we will provide some code examples to expedite the integration process.
Mechanism
The signature is hashed with SecurityKey using SHA256 algorithm.
For example:
curl 'https://domain/path/getSth?xx=1001&yy=&aa=hello&sign=signstring'
curl -X POST 'https://domain/path/updateSth' \
-d '{"xx":1001,"yy":"","aa":"hello","sign":"signstring"}' \
-H "Content-Type:application/json"Rearrange all parameters alphabetically, excluding the parameter
sign.Concatenate the rearranged parameters with
&, e.g.aa=hello&xx=1001. (yyis excluded here due to its empty value)Append
SecurityKeyto the end of stringaa=hello&xx=1001, and will get the pre-sign string likes:aa=hello&xx=1001&key=abc123Encrypt the pre-sign string by using
SHA256algorithm.Convert the ciphertext into lower case, and now the string is the
sign.
Code Examples
Last updated