數(shù)據加密(SM9)

## 接口名稱 數(shù)據加密SM9)接口 ## 接口描述 對傳入的數(shù)據進行(xíng)SM9加密。 ## 接口地址 https://idr.gdsinsing.com/tools/sm9/encrypt ## 調用方式 |方法|數(shù)據類型| |-|-| |[ ] GET|[ ] form-data| |[X] POST|[X] x-www-form-urlencoded| |[ ] PUT|[ ] raw| |[ ] DELETE|| ## 參數(shù)說明(míng) |參數(shù)名|位置|類型|必填|說明(míng)| |-|-|-|-|-| |rowText|body|String|是|原文| |publicKey|body|String|是|加密公鑰(SM9)| ## 返回結果 |屬性名稱|位置|數(shù)據類型|說明(míng)| |-|-|-|-| |success||Boolean|接口調用結果(fasle:調用失敗,true:調用成功)| |data||String|返回SM9加密結果| |msg||String|接口調用結果的文字描述(一般為(wèi)錯誤異常描述)| |ex||Json|異常信息| |code|ex|String|錯誤碼| |reson|ex|String|錯誤異常信息| |resolve|ex|String|處理(lǐ)方法文字描述| #### 成功返回 ```JavaScript { "success": true, "data": "nSaWUqdBxCskxx+wfw9GXDgyqyk9+N7DNmIl3kBf5j5AJGFl14F9lhgw7bUzWmK7vk5wgV2xC3bB2kvmaX7K0riVQS2NYetXhYju+h3FhbGijlnoIToZmJHVmKG0FAaw6rdCpg==", "msg": "", "ex": null } ``` #### 失敗返回 ```JavaScript { "success": false, "data": null, "msg": "加密失敗。", "ex": { "code": "00300010", "reason": "加密失敗。", "resolve": "請(qǐng)檢查加密公鑰與原文。" } } ``` ## 調用例子 ``` JavaScript var settings = { "url": "https://idr.gdsinsing.com/tools/sm9/encrypt", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/x-www-form-urlencoded" }, "data": { "rowText": "ABCD", "publicKey": "{加密公鑰}" } }; $.ajax(settings).done(function (response) { console.log(response); }); ```