Skip to Content
Documentation@aptos-labs/siwaReferenceisValidPublicKeyScheme

isValidPublicKeyScheme

Checks if a public key scheme is valid.

import { isValidPublicKeyScheme } from "@aptos-labs/siwa"; // Check valid schemes isValidPublicKeyScheme("ed25519"); // true isValidPublicKeyScheme("multi_ed25519"); // true isValidPublicKeyScheme("single_key"); // true isValidPublicKeyScheme("multi_key"); // true // Check invalid schemes isValidPublicKeyScheme("invalid_scheme"); // false isValidPublicKeyScheme("rsa"); // false

Specifications

Parameters:
NameTypeDefault
schemestring

The scheme to check.

Returns:
boolean

True if the scheme is a valid public key scheme, false otherwise.

Last updated on