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:
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:
Example:
Complete Request Example
Response Signature Validation
Always verify the response signature before processing the data. A response carries theClient-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.