verify

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

Verifies a signature against a given payload using the ECDSA (Elliptic Curve Digital Signature Algorithm) with the curve secp256k1. This function supports deterministic k-value generation through HMAC and SHA-256, ensuring consistent verification outcomes for identical payloads and signatures.

Parameters

publicKey

The public key used for verification, provided as a Jwk (JSON Web Key).

signedPayload

The byte array containing the data that was signed.

signature

The byte array representing the signature to be verified against the payload.

options

Optional parameter to provide additional configuration for the verification process.

Throws

If the signature does not validly correspond to the provided payload and public key, indicating either a data integrity issue

If the provided public key or signature format is invalid or not supported by the implementation.