# 开发须知

### **公私钥作用**

**甲方**为 第三方业务调用方

**乙方**为 ChainUp服务提供方

**公私钥对作用**： 甲方在后台创建应用时，需提前生成一对公私钥，其中公钥（rsa\_third\_pub）提供给乙方，私钥自己保管，私钥请勿透露给任何人。甲方在请求乙方提供的服务时，通过乙方的公钥来加密请求参数，并用甲方的私钥对MD5后的数据原文进行签名，乙方接受到请求时，通过乙方的私钥解密数据，并用甲方的公钥对MD5后的数据原文进行验签.

### 账号准备

开发者需要准备如下信息:

1. 生成一对公私钥,将公钥通过后台创建应用提交到平台
2. 第三方应用服务器IP (可选)

开发者需要保存的信息:

1. 提交到平台公钥对应的私钥: rsa\_third\_pri ;
2. 创建应用的唯一标识: app\_id;
3. 应用对应平台公钥: rsa\_saas\_pub;

RSA公私钥生产地址

{% embed url="<http://www.metools.info/code/c80.html>" %}

生产规则:

* 密码长度: 2048
* 密钥格式: PKCS#8

### 接口规则

| 传输方式:   | https                                                                                |
| ------- | ------------------------------------------------------------------------------------ |
| 签名字段:   | 除了`sign`字段，其他所有必填项都需要参与签名                                                            |
| 响应状态码为: | `0`表示处理成功，非 0 表示请求错误或系统异常                                                            |
| 请求地址:   | 域名+接口地址                                                                              |
| 加密算法:   | Java 加解密Demo ： <https://github.com/exchange-platformApi/platformV2-java-example.git> |

### 接口文档说明

下文中所有POST请求 都需要将Query对象中的参数转为json字符串, 使用rsa\_saas\_pub 进行加密后为data, 使用rsa\_third\_pri 私钥对数据进行签名 详见[调用示例](https://github.com/exchange-platformApi/platformV2-java-example/blob/b62e39e9bc1e4f9e562d82a54c1d0cb6be874fbe/exchange-platform-v2-example/src/main/java/com/chainup/open/exchangeplatformv2example/example/RequestDemo.java#L17).&#x20;


---

# Agent Instructions: 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://platformv2docs.chainup.com/kai-fa-xu-zhi.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.
