import { SkillSignatureVerificationResult } from "./types.js"; //#region src/supply-chain/signature.d.ts /** * Strategy hook used by tests so the unit suite never fetches a real * `well-known` URL. * * @experimental */ type PublicKeyFetcher = (url: string, signal?: AbortSignal) => Promise; /** * Override the public-key fetcher. Used by the test suite. * * @experimental */ declare function _setPublicKeyFetcherForTesting(fetcher: PublicKeyFetcher | null): void; /** * Strategy hook used by tests so the Sigstore branch can be exercised * without a real Fulcio + Rekor round-trip. * * @experimental */ type SigstoreVerifier = (args: { readonly identity: string; readonly issuer: string; readonly signature: string; }, signal?: AbortSignal) => Promise<{ readonly publicKeyPem: string; readonly fingerprint: string; }>; /** * Override the Sigstore verifier. Sigstore support is opt-in; the * framework keeps the surface dormant until a verifier is installed. * * @experimental */ declare function _setSigstoreVerifierForTesting(verifier: SigstoreVerifier | null): void; /** * Options accepted by `verifySkillSignature`. * * @stable */ interface VerifySkillSignatureOptions { /** Raw SKILL.md content (UTF-8 string). */ readonly skillMd: string; /** * When supplied, overrides the `publicKeyRef` block discovered in * the frontmatter. Useful for offline verification with a pinned * publisher key. */ readonly publicKeySource?: { readonly publicKeyPem: string; readonly publisher?: string; }; /** * Operator trust root. When supplied, the RESOLVED * signing key must match the trust root or verification fails * `valid: false` with `reason: 'untrusted-key'` - a self-signed skill * whose inline key is not in the root can no longer verify green. The * root is checked AFTER the ed25519 signature itself is valid, so the * result distinguishes a bad signature from an untrusted signer. */ readonly trustRoot?: SkillTrustRoot; /** Cancellation. */ readonly signal?: AbortSignal; /** Optional pre-installed strategy registry override. */ readonly publicKeyFetcher?: PublicKeyFetcher; readonly sigstoreVerifier?: SigstoreVerifier; } /** * Verify the ed25519 signature embedded in `skillMd`. Returns a * structured result instead of throwing for the validation outcome - * callers branch on `valid`. Parser-level errors (missing block, * malformed YAML) are still thrown via the supply-chain error * hierarchy. * * @stable */ declare function verifySkillSignature(options: VerifySkillSignatureOptions): Promise; /** * Operator trust root for skill signatures. At least * one leg must be non-empty to trust anything. `allowSigstore` (default * `true`) exempts sigstore-resolved keys (their identity/issuer were * already checked by the verifier). * * The `publishers` leg counts ONLY for keys resolved through the * `well-known` channel, whose URL host is verified to be the publisher's * domain (or a subdomain). The frontmatter `publisher` string is NOT * covered by the signature - anyone can claim any publisher - so an * inline key can never satisfy this leg (self-sign + claim * `publisher: trusted.example.com` used to pass). Inline keys require * the `fingerprints` leg. * * @stable */ interface SkillTrustRoot { /** Trusted key fingerprints (`sha256:`; matching is fold-normalised). */ readonly fingerprints?: ReadonlyArray; /** * Trusted publisher DNS names. Satisfied only by `well-known`-resolved * keys whose URL host equals the publisher (or is its subdomain) - * control of the HTTPS endpoint on the publisher's domain is the one * channel that can vouch for the unsigned `publisher` string. */ readonly publishers?: ReadonlyArray; /** Trust sigstore-resolved keys without a fingerprint/publisher entry. Default `true`. */ readonly allowSigstore?: boolean; } //#endregion export { PublicKeyFetcher, SigstoreVerifier, SkillTrustRoot, VerifySkillSignatureOptions, _setPublicKeyFetcherForTesting, _setSigstoreVerifierForTesting, verifySkillSignature }; //# sourceMappingURL=signature.d.ts.map