Skip to main content

Verifying Webhook Signatures

Always verify the webhook signature to ensure the payload’s integrity and authenticity.
Fenan Pay signs the webhook payload using a private key. To ensure that the webhook you receive is from Fenan Pay and hasn’t been tampered with, verify the signature using the corresponding public key:
  • Test environment: on dashboard: settings > webhook settings > webhook_pubk_test
  • Production environment: on dashboard: settings > webhook settings > webhook_pubk_prod

How Webhook Signatures Work

Fenan Pay signs the body using private key speified in setting. The signature is sent in the webhook’s signature field. You should verify the integrity of the payload by comparing the provided signature with the one generated using your webhook’s public key.
Make sure to verify the body as a string (unmodified) because any changes could invalidate the signature.
The cryptographic algorithm and signing mechanism used is SHA256withRSA with a key length of 2048 bits.

Webhook Payload Structure

Key Points to Remember

  • Signature Field: The signature field contains the cryptographic signature to verify the authenticity of the webhook body.
  • body: Ensure you verify the body as a string, as any modifications can lead to a failed verification.

Example Implementations for Verifying Webhook Signatures