RSA Signature Verification
The section describes how the RSA signature sent in the callback header can be verified. The signature is generated using RSA Signing. For verification to succeed, the public key is required.
Last updated
The section describes how the RSA signature sent in the callback header can be verified. The signature is generated using RSA Signing. For verification to succeed, the public key is required.
Last updated
Copy the public key for the environment you're working with from . This document assumes that the public key would be stored somewhere on your server under the name dusupay.public.key.pem
Below is the sample callback data for this demonstration
Obtain the value of the rsa-signature
header (if callback) OR the value of the rsa_signature
query parameter (if redirect).
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.completed:MCTREFT2WMNWZ23SBN6Y:DUSUPAYRMGRXNNYBWATKJ:COLLECTION:COMPLETED
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 (rsa-signature) on the sandbox environment. Feel free to verify it using the sample payload above and the public key.