/**
 * Run Certificate verifier — standalone surface for external clients (CLI, dashboards).
 *
 * This module is the **single source of truth** for offline verification of a
 * `SignedRunProofCertificate`. The CC server (`src/proof/ed25519-{signer,verifier}.ts`)
 * holds the signing side (DB-coupled assembly + signing); this module holds the
 * verification side, which is intentionally dependency-free (no DB, no MCP).
 *
 * Pipeline (mirrors server signer):
 *   1. Strip embedded `signature` field
 *   2. JCS-canonicalize (RFC 8785 subset: sorted keys, -0 → 0)
 *   3. SHA-256 → first 31 bytes → felt252-safe
 *   4. Poseidon([0x1, sha_felt, CERT_MARKER_FELT]) → cert_hash_felt252
 *   5. Felt → 32-byte buffer → Ed25519 verify
 *
 * Domain separator: `CERT_MARKER_FELT` = UTF-8 "run_cert" felt252 (right-aligned).
 *
 * @see ../../../src/proof/ed25519-signer.ts (signer, CC server)
 * @see docs/ietf/draft-vauban-skill-attestation-00.md (RFC profile)
 * @public
 */
import { type KeyObject } from "node:crypto";
/**
 * Ed25519 signature payload embedded in `SignedRunProofCertificate`.
 * Mirrors the server-side `SignaturePayload` (single field schema).
 */
export interface SignaturePayload {
    alg: "Ed25519";
    kid: string;
    value: string;
    pubkey_spki_b64: string;
    cert_hash_felt252: string;
    signed_at: string;
}
/**
 * A `SignedRunProofCertificate` for verification purposes — only the fields
 * the verifier touches are typed. The cert may carry additional fields
 * (decision_chain, merkle_root, etc.) which the verifier preserves but does
 * not inspect.
 */
export interface SignedRunProofCertificateLike {
    signature?: SignaturePayload;
    [key: string]: unknown;
}
export type CertVerifyFailReason = "missing_signature" | "wrong_alg" | "hash_mismatch" | "pubkey_unresolvable" | "kid_mismatch" | "signature_invalid" | "malformed_signature";
export interface CertVerifyResult {
    valid: boolean;
    reason?: CertVerifyFailReason;
    details?: string;
    recomputed_cert_hash_felt252: string;
}
export interface CertVerifyOptions {
    expectedPublicKey?: KeyObject;
    expectedKid?: string;
}
/** Domain separator: UTF-8 "run_cert" → felt252 right-aligned, zero-padded. */
export declare const CERT_MARKER_FELT: string;
/**
 * Compute the felt252 hash that Ed25519 signs over for a Run Certificate.
 * Strips any embedded `signature` field before hashing — verification is
 * idempotent.
 */
export declare function computeCertHashFelt252(cert: SignedRunProofCertificateLike): string;
/**
 * Reconstruct an Ed25519 `KeyObject` from base64 SPKI DER (as embedded in
 * `signature.pubkey_spki_b64`).
 *
 * @throws if base64 is malformed or the key is not Ed25519.
 */
export declare function publicKeyFromSpkiB64(pubkeySpkiB64: string): KeyObject;
/**
 * Verify a signed Run Certificate. Returns a structured result — never throws
 * on verification failure (only on malformed input).
 *
 * The 7 possible failure reasons are typed via `CertVerifyFailReason` so callers
 * can branch precisely. `recomputed_cert_hash_felt252` is always returned for
 * audit trail / debug inspection.
 */
export declare function verifyRunCertificate(cert: SignedRunProofCertificateLike, opts?: CertVerifyOptions): CertVerifyResult;
//# sourceMappingURL=cert-verify.d.ts.map