toip.tools

function · Browser and Node

verifySignature

Checks a signature made outside the log against the key state it names, and whether it was anchored while that key was current.

@toip-tools/eventlogView source
TypeScriptImport
import { verifySignature } from "@toip-tools/eventlog";

Declaration

TypeScriptSignature
verifySignature(input: {
    bytes: Uint8Array;
    sig: KeyRefSig;
    kel: KelResult;
    trails?: TrailResult[];
}, opts?: VerifyOptions): Promise<SignatureCheck>;

Parameters

inputrequired
{ bytes: Uint8Array; sig: KeyRefSig; kel: KelResult; trails?: TrailResult[]; }
Fields of input
bytesrequired
Uint8Array<ArrayBufferLike>
sigrequired
KeyRefSig
kelrequired
KelResult
trailsoptional
TrailResult[] | undefined
optsoptional
VerifyOptions

Default: {}

Fields of opts
allowUnwitnessedoptional
boolean | undefined

Don't require witness receipts (a controller checking its own log).

firstSeenoptional
LogStore | undefined

Compare with this store's first-seen copies.

clockoptional
Clock | undefined
verifySigoptional
((input: { key: Qb64; message: Uint8Array; sig: IndexedSig; }) => Promise<boolean | undefined> | boolean | undefined) | undefined

A pluggable verifier, tried first. Return undefined to fall back to the built-in checks.

webauthnoptional
false | WebAuthnPolicy | undefined

How to check WebAuthn-wrapped signatures. false rejects them.

Returns