UNPKG

ox

Version:

Ethereum Standard Library

61 lines 2.34 kB
import type * as Types from '../Types.js'; /** @internal */ export declare const base64UrlOptions: { readonly url: true; readonly pad: false; }; /** @internal */ export declare const responseKeys: readonly ["attestationObject", "authenticatorData", "clientDataJSON", "signature", "userHandle"]; /** @internal */ export declare function bytesToArrayBuffer(bytes: Uint8Array): ArrayBuffer; /** @internal */ export declare function bufferSourceToBytes(source: Types.BufferSource): Uint8Array; /** * Parsed authenticator data per W3C WebAuthn Level 2 §6.1. * * @internal */ export type ParsedAuthenticatorData = { /** Raw authenticator data bytes (zero-copy view). */ bytes: Uint8Array; /** SHA-256 hash of the relying party ID (32 bytes). */ rpIdHash: Uint8Array; /** Authenticator flags byte. */ flags: number; /** User Present flag. */ up: boolean; /** User Verified flag. */ uv: boolean; /** Backup Eligibility flag. */ be: boolean; /** Backup State flag. */ bs: boolean; /** Attested credential data flag. */ at: boolean; /** Extension data flag. */ ed: boolean; /** Signature counter (4-byte big-endian). */ signCount: number; }; /** * Parses the fixed 37-byte header of authenticator data into rpIdHash, flags * and signature counter. Variable-length tail (attested credential data, * extensions) is the caller's responsibility. * * @internal */ export declare function parseAuthenticatorData(authenticatorData: Uint8Array): ParsedAuthenticatorData | undefined; /** * Serializes the response fields of a WebAuthn `AuthenticatorResponse`-like * object into a base64url-encoded record. Falls back to getter methods * (e.g. `getAuthenticatorData()`) for browsers and passkey providers that * expose response fields only via getters. * * @internal */ export declare function serializeResponseFields(response: Record<string, unknown>): Record<string, string>; /** @internal */ export declare function serializeExtensions(extensions: Types.AuthenticationExtensionsClientInputs): Types.AuthenticationExtensionsClientInputs<true>; /** @internal */ export declare function deserializeExtensions(extensions: Types.AuthenticationExtensionsClientInputs<true>): Types.AuthenticationExtensionsClientInputs; //# sourceMappingURL=utils.d.ts.map