Fverify
Bun

function

crypto.verify

function verify(
algorithm: undefined | null | string,
data: ArrayBufferView,
signature: ArrayBufferView
): boolean;

Verifies the given signature for data using the given key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type.

algorithm is required to be null or undefined for Ed25519, Ed448, and ML-DSA.

If key is not a KeyObject, this function behaves as if key had been passed to createPublicKey. If it is an object, the following additional properties can be passed:

The signature argument is the previously calculated signature for the data.

Because public keys can be derived from private keys, a private key or a public key may be passed for key.

If the callback function is provided this function uses libuv's threadpool.

function verify(
algorithm: undefined | null | string,
data: ArrayBufferView,
signature: ArrayBufferView,
callback: (error: null | Error, result: boolean) => void
): void;

Verifies the given signature for data using the given key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type.

algorithm is required to be null or undefined for Ed25519, Ed448, and ML-DSA.

If key is not a KeyObject, this function behaves as if key had been passed to createPublicKey. If it is an object, the following additional properties can be passed:

The signature argument is the previously calculated signature for the data.

Because public keys can be derived from private keys, a private key or a public key may be passed for key.

If the callback function is provided this function uses libuv's threadpool.