> For the complete documentation index, see [llms.txt](https://docs.multimarkets.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.multimarkets.org/client-api/open-api/readme/sign.md).

# Sign

## 1. Signature

### 1.1 Signature Rules

The signature uses the SHA1WithRSA algorithm. The secretKey serves as the key for SHA1WithRSA, and the parameters in `param` + `timestamp` serve as the operating objects for SHA1WithRSA. The output obtained is the signature.

* Step 1: Retrieve the request parameters in the body, sort the parameters alphabetically, and form a string.
  * The sorting method "alphabetical order" means sorting from smallest to largest alphabetically, comparing the first letter first, if the same, compare the second letter, and so on.
  * Remove all double quotes, whether they are from field names or field values.
  * No spaces in between.
  * If the field is `null`, it is not included in the signature.
* Step 2: Retrieve the `timestamp` parameter from the request header and append it to the result of Step 1.
* Step 3: Use the secretKey to perform SHA1WithRSA on the result from Step 2 to generate the signature.

### 1.2 Signature Example

| Parameter | Value                                                                               |
| --------- | ----------------------------------------------------------------------------------- |
| companyId | 220                                                                                 |
| apiKey    | 1710e1f6b4b54c15bea72e8669966591                                                    |
| secretKey | MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAI5WJjsBgtiuQQZDs5qe8LBDUm2ZSa4gTBJ |

Request Parameters:

{"companyId":1,"lang":"zh-CN","customerNo":"86001308"}

Calculate Signature:

* Step 1: Retrieve the request parameters in the body and sort them alphabetically to form the following string:\
  {“companyId”:1,”customerNo”:”86001308”,”lang”:”zh-CN”}
* Step 2: Retrieve the `timestamp` parameter from the request header and append it to the result of Step 1, as follows:\
  {companyId:1,customerNo:86001308,lang:zh-CN}1650361143685
* Step 3: Use the secretKey to perform SHA1WithRSA on the result from Step 2, the result is:\
  Dihl6oOt5UkaHo9sEouquP3EqbukLX2dAOoKTSGicYryTvH1m9r6vtSLHGutZn7u34/06gjhdpbXRFPdjb51GVHvG75qWXZ1P/boL89xtuja6eTEy9q/aS8R270Q1A+m/MOTxdiifCy0IByrSpCs4VJKaj2d8jlJo2GHznsH+q0=

## 2.Attachment

Java version [demo](https://github.com/CTradeExchange/sign-demo/tree/master).


---

# 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://docs.multimarkets.org/client-api/open-api/readme/sign.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.
