/** * Import a COSE Key Map (as returned by our CBOR decoder) into a * Node `KeyObject`. * * @param {Map} coseKey * @returns {{ * algorithm: number, * name: string, * publicKey: import('node:crypto').KeyObject, * jwk: Record, * }} */ export function importCoseKey(coseKey: Map): { algorithm: number; name: string; publicKey: any; jwk: Record; }; /** * Look up the algorithm parameters for a COSE alg id. Throws if the * id is not in the supported table. * * @param {number} algId */ export function algorithmForId(algId: number): any; /** * COSE algorithm identifiers WebAuthn implementations actually use. * Anything outside this table is rejected at import time — a * silently-accepted RS1 (SHA-1 with RSA) would be a real risk. * * Keyed by COSE alg id. Each entry carries: * - `name`: human label for error messages * - `nodeAlgorithm`: string for `crypto.verify(algorithm, ...)`; * `null` means "no digest string, use the key alone" (Ed*). * - `verifyOptions`: extras to spread into `crypto.verify` call * site (PSS padding / saltLength, ECDSA DER encoding). */ export const ALGORITHMS: Readonly<{ '-7': { name: string; nodeAlgorithm: string; curve: string; verifyOptions: { dsaEncoding: string; }; }; '-35': { name: string; nodeAlgorithm: string; curve: string; verifyOptions: { dsaEncoding: string; }; }; '-36': { name: string; nodeAlgorithm: string; curve: string; verifyOptions: { dsaEncoding: string; }; }; '-8': { name: string; nodeAlgorithm: null; curve: string; verifyOptions: {}; }; '-257': { name: string; nodeAlgorithm: string; verifyOptions: {}; }; '-258': { name: string; nodeAlgorithm: string; verifyOptions: {}; }; '-259': { name: string; nodeAlgorithm: string; verifyOptions: {}; }; '-37': { name: string; nodeAlgorithm: string; verifyOptions: { padding: number; saltLength: number; }; }; '-38': { name: string; nodeAlgorithm: string; verifyOptions: { padding: number; saltLength: number; }; }; '-39': { name: string; nodeAlgorithm: string; verifyOptions: { padding: number; saltLength: number; }; }; }>; /** * Default supportedAlgorithms list used by `registration.begin` and * enforced by `finish` when the caller doesn't override — the set * every reasonable authenticator in 2026 implements. */ export const DEFAULT_SUPPORTED_ALGORITHMS: readonly number[];