RSA Signature Verification

The section describes how the RSA signature sent in the callback header or redirect query data can be verified. For verification to succeed, the public key is required.

Download the Public Key File

Download the public key file by clicking the link below and store it somewhere on your server

Public key for sandbox webhook signature verification
Public key for production webhook signature verification

Next Steps

Below is the sample callback data for this demonstration (sample redirect data is available here);

  1. Obtain the value of the rsa-signature header (if callback) OR the value of the rsa_signature query parameter (if redirect).

  2. Form the string payload to be used in signature verification. This is obtained by concatenating values of the callback/redirect data in the format; event:merchant_reference:internal_reference:transaction_type:transaction_status and these values are obtained from the callback/redirect data. The string payload would therefore be transaction.failed:MCTREFYDPE9LMZ34S8HM:GOVBILGHQ6ZDXFK7C7NJ:COLLECTION:FAILED

  3. Use the public key obtained above to verify the signature as described in the sample source codes below;

Below is an example of a generated RSA signature on the sandbox environment

Last updated