pub enum SignatureAlgorithm {
HmacSha256,
HmacSha1,
HmacSha512,
StandardWebhooks,
StripeWebhooks,
HmacSha256Base64,
Ed25519,
}Expand description
Supported signature algorithms.
Variants§
HmacSha256
HMAC-SHA256 (e.g., GitHub)
HmacSha1
HMAC-SHA1 (legacy, e.g., older GitHub)
HmacSha512
HMAC-SHA512
StandardWebhooks
Standard Webhooks (https://www.standardwebhooks.com) — used by Polar, Svix, Clerk, and others.
Signs {webhook-id}\n{webhook-timestamp}\n{body} with HMAC-SHA256.
Signature header is always webhook-signature with format v1,<base64>.
Secret prefixes whsec_ and polar_whs_ are stripped before base64 decoding.
StripeWebhooks
Stripe webhook format.
Signs {timestamp}.{body} with HMAC-SHA256. Timestamp and signatures are
extracted from the Stripe-Signature header (t=...,v1=...). Requests older
than 5 minutes are rejected to prevent replay attacks.
HmacSha256Base64
HMAC-SHA256 with base64-encoded output (e.g., Shopify).
Same algorithm as HmacSha256 but the signature is base64-encoded instead of hex.
Ed25519
Ed25519 asymmetric signature verification.
The secret_env holds a base64-encoded Ed25519 public key (32 bytes).
Used by services that sign with a private key and distribute a public key for verification.
Implementations§
Trait Implementations§
Source§impl Clone for SignatureAlgorithm
impl Clone for SignatureAlgorithm
Source§fn clone(&self) -> SignatureAlgorithm
fn clone(&self) -> SignatureAlgorithm
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignatureAlgorithm
impl Debug for SignatureAlgorithm
Source§impl PartialEq for SignatureAlgorithm
impl PartialEq for SignatureAlgorithm
impl Copy for SignatureAlgorithm
impl Eq for SignatureAlgorithm
impl StructuralPartialEq for SignatureAlgorithm
Auto Trait Implementations§
impl Freeze for SignatureAlgorithm
impl RefUnwindSafe for SignatureAlgorithm
impl Send for SignatureAlgorithm
impl Sync for SignatureAlgorithm
impl Unpin for SignatureAlgorithm
impl UnsafeUnpin for SignatureAlgorithm
impl UnwindSafe for SignatureAlgorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more