Verify a mock signature produced by mockSign.
Re-signs the message with the private key and checks that the result matches the provided signature.
Hex-encoded public key (unused; included for API parity).
UTF-8 string or bytes that were signed.
Hex-encoded signature from mockSign.
Hex-encoded private key used to produce the signature.
true if the signature matches, false otherwise.
true
false
import { mockSign, mockVerify, TEST_KEYS } from "@sebastienrousseau/crypto-testing";const sig = mockSign(TEST_KEYS.ed25519.privateKey, "msg");const ok = mockVerify(TEST_KEYS.ed25519.publicKey, "msg", sig, TEST_KEYS.ed25519.privateKey); Copy
import { mockSign, mockVerify, TEST_KEYS } from "@sebastienrousseau/crypto-testing";const sig = mockSign(TEST_KEYS.ed25519.privateKey, "msg");const ok = mockVerify(TEST_KEYS.ed25519.publicKey, "msg", sig, TEST_KEYS.ed25519.privateKey);
Verify a mock signature produced by mockSign.
Re-signs the message with the private key and checks that the result matches the provided signature.