import { type SerderKERI } from "../../../cesr/mod.js"; import type { Baser } from "../db/basing.js"; import type { ExchangeAttachment, ExchangeRouteHandler } from "./exchanging.js"; import type { Exchanger } from "./exchanging.js"; /** Output mode supported by `challenge generate`. */ export type ChallengeOutput = "json" | "string" | "words"; /** * Register the built-in challenge-response route handler on one exchanger. * * This keeps runtime creation explicit: the `Exchanger` owns exchange routing, * while the challenge module owns the `/challenge/response` application * behavior layered on top of it. */ export declare function loadChallengeHandlers(db: Baser, exchanger: Exchanger): void; /** * Accepted `/challenge/response` handler. * * Responsibilities: * - validate the route payload shape enough for durable storage * - record successful signed responses in `reps.` * * Verification of the expected challenge words remains a verifier-side policy * decision in `challenge verify`, so this handler stores all accepted * responses rather than only one caller's currently expected phrase. */ export declare class ChallengeHandler implements ExchangeRouteHandler { static readonly resource = "/challenge/response"; readonly resource = "/challenge/response"; readonly db: Baser; constructor(db: Baser); verify(args: { serder: SerderKERI; attachments: ExchangeAttachment[]; }): boolean; handle(args: { serder: SerderKERI; }): void; } /** Return one accepted challenge-response exchange message whose words match `expected`. */ export declare function findVerifiedChallengeResponse(db: Baser, signer: string, expected: readonly string[]): SerderKERI | null; /** Persist one verifier-confirmed challenge response in `chas.`. */ export declare function markChallengeVerified(db: Baser, signer: string, serder: SerderKERI): void; /** Parse CLI input into challenge words from JSON-array or whitespace-separated text. */ export declare function parseChallengeWords(input: string): string[]; /** Format one challenge-word list using the requested CLI output mode. */ export declare function formatChallengeWords(words: readonly string[], out: ChallengeOutput): string; /** * Generate a cryptographically random challenge phrase. * * The generator intentionally avoids a bundled external wordlist dependency by * deriving pronounceable four-letter pseudo-words from 12 random bits each. * That keeps the command self-contained while still giving human-friendly * tokens suitable for challenge/response workflows. */ export declare function generateChallengeWords(strength?: number): string[]; //# sourceMappingURL=challenging.d.ts.map