Skip to main content

verify_webhook_signature

Function verify_webhook_signature 

Source
pub fn verify_webhook_signature(
    signature_header: &str,
    key_id: &str,
    body: &[u8],
    lookup: &dyn BridgeLookup,
) -> Result<(), String>
Expand description

Verifies an Ed25519 webhook signature from an external platform.

Extracts the X-SCP-Signature and X-SCP-Platform-Key-Id headers, looks up the platform’s pre-registered public key, and verifies the Ed25519 signature over the raw request body.

See spec section 12.10.2.

§Errors

Returns a human-readable error string if verification fails.