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,
byte[] payload,
String signature,
String timestamp)
Verify signed event webhook requests.
|
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, IOException
publicKey: - elliptic curve public keypayload: - event payload string 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' headerNoSuchAlgorithmExceptionNoSuchProviderExceptionInvalidKeyExceptionSignatureExceptionIOExceptionpublic boolean VerifySignature(ECPublicKey publicKey, byte[] payload, String signature, String timestamp) throws NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException, SignatureException, IOException
publicKey: - elliptic curve public keypayload: - event payload bytes 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' headerNoSuchAlgorithmExceptionNoSuchProviderExceptionInvalidKeyExceptionSignatureExceptionIOExceptionCopyright © 2021. All rights reserved.