> For the complete documentation index, see [llms.txt](https://wechatpay-api.gitbook.io/wechatpay-api-v3/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wechatpay-api.gitbook.io/wechatpay-api-v3/ren-zheng.md).

# 认证

微信支付API v3只接受已经开通微信支付账号的商户请求，并使用数字签名对接口的调用方进行认证。数字签名是通过数学算法或者某种方式运算得到的电子签章，可以确定请求的完整性和真实性。我们使用SHA-256 with RSA作为数字签名的算法。

同样的，微信支付API v3也会对应答进行签名，商户可以通过签名确定应答是来自微信支付的。

商户的技术人员，请按照以下的顺序了解微信支付API v3的认证机制。

1. 了解什么是[商户API证书](/wechatpay-api-v3/ren-zheng/zheng-shu.md#shang-hu-api-zheng-shu)，并获取商户证书和私钥
2. 设置[API v3密钥](/wechatpay-api-v3/ren-zheng/api-v3-mi-yao.md)
3. 参照[签名生成](/wechatpay-api-v3/qian-ming-zhi-nan-1/qian-ming-sheng-cheng.md)，使用**商户私钥**实现对请求的签名
4. 通过API下载[微信支付平台证书](/wechatpay-api-v3/ren-zheng/zheng-shu.md#ping-tai-zheng-shu)，并使用API v3密钥解密证书
5. 参照[签名验证](/wechatpay-api-v3/qian-ming-zhi-nan-1/qian-ming-yan-zheng.md)，使用**平台公钥**实现对应答签名的验证

我们建议商户基于微信支付官方提供的SDK来开发应用。SDK为商户的技术人员封装了请求的签名和应答的验签，简化了商户系统的开发工作。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wechatpay-api.gitbook.io/wechatpay-api-v3/ren-zheng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
