Verifying the signature

Last updated: 2019-4-4

MD5 sign type

After receiving the character string of the response or notification from Alipay system, similar to the steps taken in Signing the data, append the MD5 secret key to the character string to generate a new string. Then, calculate this new string with the MD5 signature algorithm. After the 32-byte signature result string is generated, verify whether the value is equal to the value passed in the sign parameter. If Yes, the verification is passed.

RSA/DSA sign type

After receiving a response or notification, perform the following steps to verify the signature:

  1. Generate the pre-sign string as described inĀ Generating Pre-sign String.
  2. Use the RSA/DSA algorithm to calculate a message digest.
  3. Use the RSA/DSA public key to de-sign the signature (the value of the sign field) to a message digest.
  4. Compare the two message digests obtained in step 2 and step 3. If the digests are the same, then it indicates that the signed data has not been changed.

If you have any question, please contact us