Current location - Quotes Website - Signature design - How to realize the digital signature of apu, the web service of Gaode Map?
How to realize the digital signature of apu, the web service of Gaode Map?
The steps of digital signature by app are as follows:

1. Open digital signature: In the console of Gaode Open Platform, enter "Application Management-My Application" and select the corresponding button. When creating a key, turn on the Digital Signature option.

2. Obtain private key: After submission, enter the setting page again to check the generated private key. Please pay attention to save the private key to prevent leakage.

3. Generate signature: use MD5 algorithm to sort the key-value pairs of the requested parameters in ascending order of parameter names, and then sign. Signature format: sig=MD5 (request parameter key-value pair (sorted by parameter name in ascending order), plus private key).

4. Add signature: add the generated signature as a parameter to the request parameter. The parameter is named "sig" and the value is calculated according to the request parameter and the private key.

5. It should be noted that the content of the generated signature must be in UTF-8 encoding format. If there is a "+"sign in the parameter used to calculate MD5, you need to use URL encoding to process the request.