StripeKit 0.1.1
Stripe integration toolkit for C++
Loading...
Searching...
No Matches
stripekit::WebhookSignatureVerifier Class Referenceabstract

Checks that a webhook delivery really came from Stripe. More...

#include <WebhookVerifier.h>

Inheritance diagram for stripekit::WebhookSignatureVerifier:
[legend]

Public Member Functions

virtual ~WebhookSignatureVerifier ()=default
 Destroys the verifier instance.
virtual VerificationMetadata verify (const WebhookVerificationInput &input) const =0
 Checks a signature and reports what it contained.

Detailed Description

Checks that a webhook delivery really came from Stripe.

Applications do not normally use this directly — stripekit::webhooks::construct_event() and stripekit::webhooks::process_event_once() do the verification for them. It is worth implementing only to substitute a different crypto backend, or to inject failures in tests.

Definition at line 68 of file WebhookVerifier.h.

Constructor & Destructor Documentation

◆ ~WebhookSignatureVerifier()

virtual stripekit::WebhookSignatureVerifier::~WebhookSignatureVerifier ( )
virtualdefault

Destroys the verifier instance.

Member Function Documentation

◆ verify()

virtual VerificationMetadata stripekit::WebhookSignatureVerifier::verify ( const WebhookVerificationInput & input) const
pure virtual

Checks a signature and reports what it contained.

Parameters
inputThe payload, signature header, secret, and timing rules.
Returns
The timestamp and signed string from the verified signature.
Exceptions
SignatureVerificationExceptionThe header is malformed, no signature matches, or the timestamp is outside the tolerance.

Implemented in stripekit::DefaultWebhookSignatureVerifier.


The documentation for this class was generated from the following file: