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:| Name | Type | Default |
|---|---|---|
output | { publicKey: PublicKey; signature: Signature; input: AptosSignInInput & AptosSignInBoundFields; }The | |
options | { aptos?: Aptos; } |
Last updated on