public class EventWebhook extends Object
| Constructor and Description |
|---|
EventWebhook() |
| Modifier and Type | Method and Description |
|---|---|
ECPublicKey |
ConvertPublicKeyToECDSA(String publicKey)
Convert the public key string to a ECPublicKey.
|
boolean |
VerifySignature(ECPublicKey publicKey,
String payload,
String signature,
String timestamp)
Verify signed event webhook requests.
|
public ECPublicKey ConvertPublicKeyToECDSA(String publicKey) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeySpecException
publicKey: - verification key under Mail SettingsNoSuchAlgorithmExceptionNoSuchProviderExceptionInvalidKeySpecExceptionpublic boolean VerifySignature(ECPublicKey publicKey, String payload, String signature, String timestamp) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, SignatureException
publicKey: - elliptic curve public keypayload: - event payload in the request bodysignature: - value obtained from the
'X-Twilio-Email-Event-Webhook-Signature' headertimestamp: - value obtained from the
'X-Twilio-Email-Event-Webhook-Timestamp' headerNoSuchAlgorithmExceptionNoSuchProviderExceptionInvalidKeyExceptionSignatureExceptionCopyright © 2020. All rights reserved.