> ## Documentation Index
> Fetch the complete documentation index at: https://developer.speedpay.hk/llms.txt
> Use this file to discover all available pages before exploring further.

# 签名示例

> 请求签名与回调验签示例。

## 请求签名伪代码

```text theme={null}
S1 = request.body
bytes = SHA256withRSA(S1, private_pkcs8)
sign = BASE64(bytes)
```

## 请求 Header 示例

```http theme={null}
Content-Type: application/json
Authorization: BASE64_SIGNATURE
```

## 回调验签伪代码

```text theme={null}
S1 = request.body
valid = SHA256withRSA_VERIFY(S1, BASE64_DECODE(Authorization), speedpay_public_key)
```

请求签名使用商户私钥，平台使用商户公钥验签。回调验签使用 SpeedPay 公钥。
