hooksig

hooksig  /  PayPal

RSA-SHA256 · base64 · no timestamp

PayPal

Not HMAC at all. PayPal signs with RSA; you verify against their public certificate.

Try it — live, in your browser

RSA-SHA256 · base64 · no timestamp
Request — edit anything
Verify this in code
import { verify } from "hooksig";

const result = await verify("paypal", {
  payload: rawBody,
  headers: request.headers,
  webhookId: env.PAYPAL_WEBHOOK_ID,
  publicKey: cachedPayPalKey,   // from paypal-cert-url
});

if (!result.verified) {
  return new Response(result.reason, { status: 400 });
}
no match — signature invalid
Signed string
RSA-SHA256 verify( publicKey, signed string, signature )
Signature
provided
Does not verify against the supplied public key.
How it's built

    The scheme

    Gotchas

    Official PayPal docs →