数据签名流程

<p class="shortdesc"></p> <section class="section" id="process__section_qbm_hgh_1mb"><h2 class="doc-tairway">输入</h2> <p class="p">设置所有公共参数和业务参数的值:</p> <ul class="ul" id="process__ul_ujw_5fh_1mb"> <li class="li">业务参数:Action=GetUser</li> <li class="li">公共参数:AccessKeyId=XXXXXXXX, version=2017-01-01, signatureVersion=1.0, signatureMethod=HMAC-SHA256, Timestamp=1579516096440, signatureNonce=14489499455</li> </ul> </section> <section class="section" id="process__section_dw3_3gh_1mb"><h2 class="doc-tairway">编码</h2> <p class="p">将所有键值对以application/x-www-form-urlencoded格式进行编码,例如,编码前的值为空格,编码后的值变为+。</p> <p class="p">编码完成后替换部分特殊字符的值,包括:+替换为%20,*替换为%2A,%7E替换为~。</p> </section> <section class="section" id="process__section_mfb_k3h_1mb"><h2 class="doc-tairway">转换</h2> <p class="p">将所有编码后的键值对转换为小写:action=getuser, accesskeyid=xxxxxxxx, version=2017-01-01, signatureversion=1.0, signaturemethod=hmac-sha256, timestamp=1579516096440, signaturenonce=14489499455</p> </section> <section class="section" id="process__section_vmg_s3h_1mb"><h2 class="doc-tairway">排序</h2> <p class="p">以字母序对所有键值对进行排序:accesskeyid=xxxxxxxx, action=getuser, signaturemethod=hmac-sha256, signaturenonce=14489499455, signatureversion=1.0, tmestamp=1579516096440, version=2017-01-01</p> </section> <section class="section" id="process__section_p42_jjh_1mb"><h2 class="doc-tairway">拼接</h2> <p class="p">以&字母序对所有键值对进行拼接,形成待签名的数据:accesskeyid=xxxxxxxx&action=getuser&signaturemethod=hmac-sha256&signaturenonce=14489499455&signatureversion=1.0&timestamp=1579516096440& version=2017-01-01</p> </section> <section class="section" id="process__section_tkk_4jh_1mb"><h2 class="doc-tairway">签名</h2> <p class="p">以AccessKeySecret为密钥,使用HMAC-SHA256对数据进行签名,得到签名值signature=yyyyyyyy,如果signature的值中包含+字符,将+字符替换为%2B,如将yyyy+yyyy替换为yyyy%2Byyyy。</p> </section> <section class="section" id="process__section_vsr_tjh_1mb"><h2 class="doc-tairway">请求</h2> <p class="p">将signature的信息附加在请求URL后,使用原始数据(未编码、未转换的参数)发送请求,发送请求时对参数顺序无特殊要求。</p> </section>
以上内容是否解决了您的问题?
请补全提交信息!
联系我们

电话咨询

400-151-8800

邮件咨询

fincloud@ocft.com

在线客服

工单支持

解决云产品相关技术问题