Signature
in package
FinalYes
Checks the Ed25519 signature Discord puts on every request it sends to an application.
Uses PHP's bundled sodium extension, falling back to simplito/elliptic-php, which is pure PHP but much slower.
Tags
Table of Contents
Methods
- assertAvailable() : void
- verify() : bool
- Whether a request was signed by Discord for this application.
Methods
assertAvailable()
public
static assertAvailable() : void
Tags
verify()
Whether a request was signed by Discord for this application.
public
static verify(string $publicKey, string $signature, string $timestamp, string $body) : bool
Parameters
- $publicKey : string
-
The application's hex-encoded
verify_key. - $signature : string
-
The
X-Signature-Ed25519header. - $timestamp : string
-
The
X-Signature-Timestampheader. - $body : string
-
The raw request body.