Skip to main content

Overview

This tutorial shows you how to verify the signature of incoming webhooks from the Issuing API using Java. This ensures that webhook requests are authentic and come from our servers.

Complete Code

Here is the complete WebhookSignVerifier class:

Step 1: Paste the public key

The publicKeyPem variable contains the Issuing API Webhook public key. This is used to verify that webhook requests come from our servers.

Step 2: Get the signature from header

Get x-access-signature from the header of the webhook request and assign it to the signature variable.

Step 3: Get the webhook body in JSON string

Get the raw webhook request body as a JSON string and assign it to the webhookBody variable.

Step 4: Run the main function

Run the verifier to check if the webhook signature is valid:
The program will print true if the signature is valid, false otherwise.

Next Steps