Skip to Content
Documentation@aptos-labs/siwaReferenceverifySignInSignature

verifySignInSignature

Verifies whether the signature is valid for the given AptosSignInInput and public key. This is used to verify the signature and AptosSignInInput acquired from the wallet in the AptosSignInOutput.

import { verifySignInSignature, deserializeSignInOutput, type SerializedAptosSignInOutput } from "@aptos-labs/siwa"; const serializedOutput: SerializedAptosSignInOutput = // ... response from the `serializeSignInOutput` function const output = await deserializeSignInOutput(serializedOutput); // Verify the signature matches the message const result = await verifySignInSignature({ publicKey: output.publicKey, signature: output.signature, input: output.input, }); if (!result.valid) { // Signature verification failed: result.errors }

Specifications

Parameters:
NameTypeDefault
output{ publicKey: PublicKey; signature: Signature; input: AptosSignInInput & AptosSignInBoundFields; }

The AptosSignInOutput to verify against the input.

options{ aptos?: Aptos; }
Returns:
Promise<VerificationResult>

The AptosSignInInput fields that are parsed from the message.

Last updated on