/** * Format a 16-byte AAGUID as the canonical `xxxxxxxx-xxxx-xxxx- * xxxx-xxxxxxxxxxxx` string used by MDS and browsers. * * @param {Uint8Array} aaguid * @returns {string} */ export function formatAaguid(aaguid: Uint8Array): string; /** * @typedef {import('./flags.js').AuthFlags} AuthFlags * * @typedef {object} AttestedCredentialData * @property {Uint8Array} aaguid 16 bytes. * @property {string} aaguidString Canonical hyphenated form. * @property {Uint8Array} credentialId * @property {Map} credentialPublicKey * Raw COSE Key Map — feed to `importCoseKey` for a `KeyObject`. * @property {Uint8Array} credentialPublicKeyBytes * The exact CBOR bytes that encoded the public key. Kept because * some attestation checks re-hash this blob and byte-equality * with the original is required. * * @typedef {object} ParsedAuthData * @property {Uint8Array} rpIdHash * @property {AuthFlags} flags * @property {number} signCount * @property {AttestedCredentialData | null} attestedCredentialData * @property {Map | null} extensions Raw decoded map, or null. * @property {Uint8Array} raw The input bytes, unchanged. */ /** * Parse an authenticator-data blob. Throws with an explicit reason * on any length / structure violation. * * @param {Uint8Array} bytes * @returns {ParsedAuthData} */ export function parseAuthData(bytes: Uint8Array): ParsedAuthData; export type AuthFlags = import("./flags.js").AuthFlags; export type AttestedCredentialData = { /** * 16 bytes. */ aaguid: Uint8Array; /** * Canonical hyphenated form. */ aaguidString: string; credentialId: Uint8Array; /** * Raw COSE Key Map — feed to `importCoseKey` for a `KeyObject`. */ credentialPublicKey: Map; /** * The exact CBOR bytes that encoded the public key. Kept because * some attestation checks re-hash this blob and byte-equality * with the original is required. */ credentialPublicKeyBytes: Uint8Array; }; export type ParsedAuthData = { rpIdHash: Uint8Array; flags: AuthFlags; signCount: number; attestedCredentialData: AttestedCredentialData | null; /** * Raw decoded map, or null. */ extensions: Map | null; /** * The input bytes, unchanged. */ raw: Uint8Array; };