verify

open override fun verify(publicKey: Jwk, signedPayload: ByteArray, signature: ByteArray, options: VerifyOptions?)

Verify the signature of a given payload using a public key.

This function attempts to verify the signature of a provided payload using a public key, supplied in Jwk (JSON Web Key) format, and a signature. The verification process checks the validity of the signature against the provided payload, respecting any optional verification options provided via VerifyOptions.

Parameters

publicKey

The public key in Jwk format used for verifying the signature. Must not be null.

signedPayload

The original payload/data that was signed, to be verified against its signature. Must not be null.

signature

The signature to be verified against the payload and public key. Must not be null.

options

Optional parameter containing additional options to control the verification process. Default is null.

Throws

if the verification fails.