/encsign
/nssig
数据加密签名接口,用于对数据进行加密并生成签名。
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| data | string | 是 | 需要加密的数据 |
| timestamp | integer | 是 | Unix 时间戳(秒) |
$SIGN_API = "http://127.0.0.1:52000"
$timestamp = [int][double]::Parse((Get-Date -UFormat %s))
$encsignData = @{
data = "your_data_here"
timestamp = $timestamp
} | ConvertTo-Json
try {
$response = Invoke-RestMethod -Uri "${SIGN_API}/encsign" `
-Method Post `
-Headers @{
"Content-Type" = "application/json"
"User-Agent" = "Mozilla/5.0"
} `
-Body $encsignData `
-TimeoutSec 30
$response | ConvertTo-Json -Depth 10
}
catch {
Write-Host "Request failed: $($_.Exception.Message)"
}
curl -X POST "http://127.0.0.1:52000/encsign" \
-H "Content-Type: application/json" \
-H "User-Agent: Mozilla/5.0" \
-d '{
"data": "your_data_here",
"timestamp": 1772481384
}'
const timestamp = Math.floor(Date.now() / 1000);
fetch('http://127.0.0.1:52000/encsign', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0'
},
body: JSON.stringify({
data: 'your_data_here',
timestamp: timestamp
})
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
import requests
import time
import json
url = "http://127.0.0.1:52000/encsign"
timestamp = int(time.time())
payload = {
"data": "your_data_here",
"timestamp": timestamp
}
headers = {
"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0"
}
try:
response = requests.post(url, json=payload, headers=headers, timeout=30)
print(response.json())
except Exception as e:
print(f"Request failed: {e}")
{
"status": true,
"data": {
"encdata": "WlTuzeTU6mGT9525bjJUVHpueQIEQ3pjgjAw+tDz1mY6segytHVJY7xrkz6lP6Sy...",
"sign": "5a54eecde4d4ea61264d1a4eb450dc7b107a61122195b5ca9e76ad3771005b4e"
}
}
| 字段名 | 类型 | 说明 |
|---|---|---|
| status | boolean | 请求是否成功 |
| data.encdata | string | 加密后的数据 |
| data.sign | string | 数据签名(64位十六进制字符串) |