About The Sign

  • Currently, the secret (secrete) is obtained through offline methods or the merchant management platform.

  • secrete:The secret is used to digest and sign the input parameters for API requests. It should be kept by the merchant themselves, and it is essential to ensure strict security measures to prevent its disclosure to external parties.

  • To generate a signature string:all the parameters that need to be verified should be assembled into an array and sorted in ascending order based on the parameter names’ dictionary order using ASCII code. It’s important to note that only the parameter keys are sorted, and the values are not involved in the sorting process.

  • All required field values participate in the signature calculation (excluding “sign”).

Sign Example

  • Parameters Example

JSON

{
  "email": "123213@ach.com",
  "appId": "qmamnbodyqzbdr0w"
}
  • To prepare the string for signing, convert the format of each parameter to “parameter_name=parameter_value” and join them using the “&” symbol. Finally, append the key (secrete) at the end. The resulting string would be as follows:

Text

appId=qmamnbodyqzbdr0w&email=123213@ach.com&key=6fdbaac29eb94bc6b36547ad705e9298
  • Next, apply the SHA-512 algorithm to the prepared signing string to generate the final signature. The signature result is as follows:

Text

8979EEB59CF15246A04E033962CA4084973A9D0F2F5CC08F07B99E9D0338F4486ED7700CF78F6365C2E399ED593B3EF9059F2EC808B5107CED8CC17BA0475962

Java Signature Generation Code Example:

Java

Encryption Utility Class:

Java

Last updated