/** * @nexart/codemode-sdk — Node Receipt Verification (v1.9.0) * * Offline Ed25519 signature verification for Code Mode attestation receipts. * Browser and Node.js compatible — uses @noble/ed25519 with @noble/hashes/sha2. * * Usage: * const res = await verifyBundleAttestation(bundle, { nodeUrl }); * console.log(res.ok, res.code); */ import type { NodeKeysDocument, SignedAttestationReceipt, NodeReceiptVerifyResult } from './types.js'; /** * Verify an Ed25519 signature over the canonical JSON bytes of a receipt. * * @param params.receipt - The receipt object that was signed. * @param params.signatureB64Url - Base64url-encoded 64-byte Ed25519 signature. * @param params.key - Public key in one of: JWK, raw base64url, or SPKI. */ export declare function verifyNodeReceiptSignature(params: { receipt: SignedAttestationReceipt; signatureB64Url: string; key: { jwk?: NodeKeysDocument['keys'][number]['publicKeyJwk']; spkiB64?: string; rawB64Url?: string; }; }): Promise; /** * Fetch node keys from /.well-known/nexart-node.json on the attestation node. */ export declare function fetchNodeKeys(nodeUrl: string): Promise; type SelectKeySuccess = { key: NodeKeysDocument['keys'][number]; error?: never; }; type SelectKeyFailure = { error: NodeReceiptVerifyResult; key?: never; }; type SelectKeyResult = SelectKeySuccess | SelectKeyFailure; /** * Select the appropriate key from a NodeKeysDocument. * * Priority: explicit kid → activeKid → first key in array. */ export declare function selectNodeKey(doc: NodeKeysDocument, kid?: string): SelectKeyResult; /** * Fully verify a Code Mode bundle's node attestation (offline). * * Steps: * 1. Extract signed receipt + signature from the bundle. * 2. Cross-check receipt.certificateHash === bundle.certificateHash. * 3. Fetch node keys from nodeUrl. * 4. Select the key (by kid, activeKid, or first). * 5. Verify the Ed25519 signature over canonical JSON of the receipt. * * @param bundle - A Code Mode snapshot bundle (any recognised layout). * @param options - nodeUrl to fetch keys from; optional kid to select. */ export declare function verifyBundleAttestation(bundle: unknown, options: { nodeUrl: string; kid?: string; }): Promise; export {}; //# sourceMappingURL=nodeReceipt.d.ts.map