<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<a style="box-sizing: inherit; background-color: transparent; color: rgb(30, 112, 191); font-family: 宋体, SimSun; text-decoration: underline;"><span style="font-family: 宋体, SimSun;"><strong><span style="box-sizing: inherit; font-size: 29px; font-family: 微软雅黑, sans-serif;">数据签名</span></strong></span></a>
</p>
<p style="box-sizing: inherit;line-height: 23px;margin-top: 0px;margin-right: 7px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-size: 16px; font-family: 宋体, SimSun;">为了保证数据传输过程中的数据真实性和完整性,我们需要对数据进行数字签名,在接收签名数据之后进行签名校验。</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="color: rgb(0, 112, 192); font-family: 宋体, SimSun;"><strong><span style="color: rgb(0, 112, 192); box-sizing: inherit; font-family: 微软雅黑, sans-serif; font-size: 24px;">签名原始串</span></strong></span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px 0px 1px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252);border-width: initial;border-style: none;border-color: initial">
<span style="box-sizing: inherit; font-size: 16px; font-family: 宋体, SimSun;">无论请求还是应答,签名原始串按以下方式组装成字符串</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px 0px 1px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252);border-width: initial;border-style: none;border-color: initial">
<span style="box-sizing: inherit; font-size: 16px; font-family: 宋体, SimSun;">1、data 字段内,所有参数按照字段名的 ascii 码从小到大排序后使用 QueryString 的格式(即key1=value1&key2=value2...)拼接而成,空值不传递,不参与签名组串。</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px 0px 1px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252);border-width: initial;border-style: none;border-color: initial">
<span style="box-sizing: inherit; font-size: 16px; font-family: 宋体, SimSun;">2、签名原始串中,字段名和字段值都采用原始值,不进行 URL Encode。</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px 0px 1px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252);border-width: initial;border-style: none;border-color: initial">
<span style="box-sizing: inherit; font-size: 16px; font-family: 宋体, SimSun;">3、返回的应答或通知消息可能会由于升级增加参数,请验证应答签名时注意允许这种情况。</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="color: rgb(0, 112, 192); font-family: 宋体, SimSun;"><strong><span style="color: rgb(0, 112, 192); box-sizing: inherit; font-family: 微软雅黑, sans-serif; font-size: 24px;">签名算法</span></strong></span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-size: 16px; color: red; font-family: 宋体, SimSun;">签名只针对data字段数据</span>
</p>
<p class="MsoListParagraph" style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;margin-left: 24px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;">1, 将data字段中的数据按照ascii 码从小到大排序后使用 QueryString 的格式(即key1=value1&key2=value2...)拼接而成</span>
</p>
<p class="MsoListParagraph" style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;margin-left: 24px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;">2, 对拼接好的字符串在后面连接上 &key=平台密钥</span>
</p>
<p class="MsoListParagraph" style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;margin-left: 24px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;">3, 把得到的字符串使用MD5加密</span>
</p>
<p class="MsoListParagraph" style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;margin-left: 24px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;">4,把MD5加密后的字符串转为大写</span>
</p>
<p style="box-sizing: inherit;line-height: 2;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;"> </span>
</p>
<p style="box-sizing: inherit;line-height: 20px;margin-top: 0px;margin-bottom: 0px;padding: 0px;color: rgb(82, 82, 82);font-family: 'Helvetica Neue', NotoSansHans-Regular, AvenirNext-Regular, arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'WenQuanYi Micro Hei', serif;font-size: 15px;white-space: normal;background-color: rgb(252, 252, 252)">
<span style="box-sizing: inherit; font-family: 宋体, SimSun;">最终签名格式例如:<span style="box-sizing: inherit; font-family: 宋体, SimSun; color: rgb(255, 0, 0);">1802BF462E9DCD422BCF42D181068655</span></span>
</p>
<p>
<br/>
</p>