Skip to main content
Before calling any API, you must sign requests and validate response signatures to ensure message security and integrity.

Request Signing Process

Step 1: Prepare Your Private Key

Ensure your private key is ready. It must be a 2048-bit RSA key.

Step 2: Construct Content to Sign

Build a string combining the HTTP method, URI, client identifier, timestamp, and request body:
Components: Example content to sign:

Step 3: Generate Signature

Apply RSA with SHA-256 algorithm to generate the signature:

Step 4: Add Signature to Header

Format and add the signature header to your request:
The signature value is URL-encoded Base64, not the RFC 4648 base64url alphabet. A correctly encoded value contains percent-escapes such as %2B, %2F and %3D instead of +, / and =. See Message Encoding.
Example:

Complete Request Example

Response Signature Validation

Always verify the response signature before processing the data. A response carries the Client-Id, Response-Time and Signature headers, for example:
1

Obtain the platform public key

Use the Client-Id and keyVersion from the response header to select the Rebell public key provided to you for that key version.
2

Construct the content to validate

Build the string below from the request method and URI, and the response Client-Id, Response-Time and raw response body.
3

Extract the signature

Take <target_signature> from Signature: algorithm=SHA256withRSA, keyVersion=1, signature=<target_signature>.
4

Validate

sha256withrsa_verify(base64UrlDecode(<target_signature>), <Content_To_Be_Validated>, <serverPublicKey>) — URL-decode, then Base64-decode the signature before verifying.

Construct Content to Validate

Mirror the request signing process using response data:

Verify Signature

Key Points

Security Alert: Never log or expose the full signature content or private key. If you need to debug signature issues, log only non-sensitive parts like the method and URI.