Verify a signature against a message and a public key.


function verifySignature (data: SignMessageResponseData): Promise<boolean>interface SignMessageResponseData {  // The public key of the authenticated user  pubkey: string  /**   * The challenge that was requested to be signed   */  challenge: string  /**   * The message that was signed by the authenticator,   * Note that the message may not be the original raw message,   * but is combined with client data and authenticator data   * according to [WebAuthn Spec](   */  message: string  /**   * The signature of the message that was signed by the authenticator   */  signature: string  /**   * key type of the authenticated user   */  keyType: 'main_key' | 'sub_key' | 'main_session_key' | 'sub_session_key'  /**   * Custom state that will be returned to your app after signing   */  state?: any  /**   * The algorithm of the signature.   * corresponds to the `value` field of the [COSE]( structure   */  alg: number  /**   * The attestation of the signature,   * only available when keyType is `main_session_key` or `sub_session_key`   */  attestation?: string}


import { signWithPopup, verifySignature } from '@joyid/core'const { error, data } = await signWithPopup(request)if (error == null) {  const result = await verifySignature(data)  alert(result) // true or false}


Table of Contents