import { hasher } from "../../ap2/sdjwt.js"; import type { MandateContent } from "./mandates.js"; /** Re-exported for the in-process wallet, which must hash the way this verifier does. */ export { hasher }; /** * The audience a Key Binding JWT must name, for a presentation made over the Digital * Credentials API. * * OpenID4VP 1.0 §B.3.6: the `aud` claim MUST be the value of the Client Identifier, EXCEPT for * requests over the DC API, where it MUST be the Origin prefixed with `origin:` (Appendix A.4). * This rail responds over `dc_api.jwt`, so the prefixed form is the correct one — not the bare * origin, and not the `client_id`. * * It is a function so the gate and the simulated wallet cannot drift apart. They did: the * simulator sent the bare origin, every test passed, and the first real wallet was refused with * "key binding is addressed to origin:https://… , not this verifier". */ export declare function dcApiAudience(origin: string): string; export type PresentationResult = { ok: true; /** The KB-JWT's `delegate_payload`, verbatim — array-element digests of the mandates the * holder signed (Delegate SD-JWT §7.1). Compare against the server's own record. */ delegatePayload: MandateContent[]; /** Disclosed claims, for the explicit-positive-claim check (invariant 5). */ disclosed: Record; /** The credential type that signed — recorded on the grant. */ vct: string; } | { ok: false; reason: string; }; /** * Verify an SD-JWT VC presentation carrying an AP2 delegation. * * Fail-closed on every axis. `audience` and `nonce` are REQUIRED: a key-bound presentation * checked without them verifies a signature over bytes that could have been produced for any * other verifier, at any other time, which is exactly what replay is. */ export declare function verifyDelegatedPresentation(args: { /** The compact SD-JWT presentation from `vp_token`. */ sdjwt: string; /** Who the KB-JWT must be addressed to — this gate's origin. */ audience: string; /** The nonce this ceremony issued. */ nonce: string; nowMs?: number; }): Promise;