verify
fun verify(msgBody: String, msgId: String?, msgSignature: String?, msgTimestamp: String?): WebhookRequest?
Verifies a webhook message. When the verification fails, throws WebhookVerificationException.
If the verification fails, the caller should not trust the request. It is recommended to simply log the failure and ignore the request.
msgId, msgSignature and msgTimestamp are declared nullable for convenience. If any of the parameters are null, the verification fails.
Parameters
msg Body
the body of the request.
msg Id
the value of the header whose name equals HEADER_ID.
msg Signature
the value of the header whose name equals HEADER_SIGNATURE.
msg Timestamp
the value of the header whose name equals HEADER_TIMESTAMP.
Throws
when the verification fails.