Class WebhookUtility
The webhook event utility.
public static class WebhookUtility
- Inheritance
-
WebhookUtility
- Inherited Members
Fields
BoldSignEventHeader
The BoldSign event header.
public const string BoldSignEventHeader = "X-BoldSign-Event"
Field Value
BoldSignSignatureHeader
The BoldSign signature header.
public const string BoldSignSignatureHeader = "X-BoldSign-Signature"
Field Value
Methods
ParseEvent(string)
Parses a JSON string from a BoldSign webhook into a WebhookEvent object.
public static WebhookEvent ParseEvent(string json)
Parameters
json
stringThe JSON string to parse.
Returns
- WebhookEvent
The deserialized WebhookEvent.
ValidateSignature(string, string, string, long)
Comparing the hmac signature by request header.
public static void ValidateSignature(string json, string signatureHeader, string secretKey, long tolerance = 300)
Parameters
json
stringThe json payload from the webhook request.
signatureHeader
stringThe signature header (Key name: BoldSignSignatureHeader) from the webhook request.
secretKey
stringThe webhook secret key.
tolerance
longThe timestamp tolerance (defaults to 300 seconds).
Exceptions
- ArgumentNullException
Thrown when one of the required input is null or empty.
- BoldSignSignatureException
Thrown when there is mismatch in signature comparison.