签名算法

签名算法

我们用如下URL演示加密算法:

https://apix.jiuyescm.com/v1/oms/receive?customerid=20001&timestamp=20170101120000&key=abc&method=expressnum&sign=123

输入参数

customerid =20001
timestamp=20170101120000
key=abc
method = expressnum
sign_method=md5

按首字母升序排列

customerid =20001
key = abc
method = expressnum
sign_method=md5
timestamp =20170101120000

连接字符串

连接参数名与参数值,并在首尾加上secret,此处假设secret=test,如下:

testcustomerid20001keyabcmethodexpressnumsign_methodmd5timestamp20170101120000bodytest

其中:body用请求中的body数据代替

生成签名

32位大写MD5值-> B8F7179FCB1B93DD2FF504AD443FD0D2