Class GHWebhookSignature
java.lang.Object
org.jenkinsci.plugins.github.webhook.GHWebhookSignature
Utility class for dealing with signatures of incoming requests.
- Since:
- 1.21.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
sha1()
Computes a RFC 2104-compliant HMAC digest using SHA1 of a payloadFrom with a given key (secret).static GHWebhookSignature
webhookSignature
(String payload, Secret secret)
-
Field Details
-
INVALID_SIGNATURE
- See Also:
-
-
Method Details
-
webhookSignature
- Parameters:
payload
- Clear-text to create signature of.secret
- Key to sign with.
-
sha1
Computes a RFC 2104-compliant HMAC digest using SHA1 of a payloadFrom with a given key (secret).- Returns:
- HMAC digest of payloadFrom using secret as key. Will return COMPUTED_INVALID_SIGNATURE on any exception during computation.
-
matches
- Parameters:
digest
- computed signature from external place (GitHub)- Returns:
- true if computed and provided signatures identical
-