数据解密(SM4)
## 接口名称
数据加密(SM4)接口
## 接口描述
对传入的SM4秘文进行解密。
## 接口地址
https://idr.gdsinsing.com/tool/sm4/decrypt
## 调用方式
|方法|数据类型|
|-|-|
|[ ] GET|[ ] form-data|
|[X] POST|[X] x-www-form-urlencoded|
|[ ] PUT|[ ] raw|
|[ ] DELETE||
## 参数说明
|参数名|类型|必填|说明|
|-|-|-|-|
|encryptedText|String|是|秘文|
|key|String|是|SM4密钥|
## 返回结果
|属性名称|位置|数据类型|说明|
|-|-|-|-|
|success||Boolean|接口调用结果(fasle:调用失败,true:调用成功)|
|data||String|返回SM4解密结果|
|msg||String|接口调用结果的文字描述(一般为错误异常描述)|
|ex||Json|异常信息|
|code|ex|String|错误码|
|reson|ex|String|错误异常信息|
|resolve|ex|String|处理方法文字描述|
#### 成功返回
```JavaScript
{
"success": true,
"data": "ABCD",
"msg": "",
"ex": null
}
```
#### 失败返回
```JavaScript
{
"success": false,
"data": null,
"msg": "解密失败",
"ex": {
"code": "00300007",
"reason": "解密失败",
"resolve": "请检查密钥是否正确。"
}
}
```
## 调用例子
``` JavaScript
var settings = {
"url": "https://idr.gdsinsing.com/tools/sm4/decrypt",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
"data": {
"encryptedText": "+tiW9ZJf/EUnz080pXprRw==",
"key": "rZo/agnlc2T5FRJQz6i6rg=="
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
```