import { OPEN_PRINT_V1_VERIFICATION_ASSURANCE, type V1CollectorClaims } from "./policy.js"; export declare const OPEN_PRINT_V1_VERSION: "1.0"; export declare const OPEN_PRINT_V1_CERTIFICATE_SCHEMA: "https://openprint.art/schemas/certificate/v1.0.json"; export declare const OPEN_PRINT_V1_ISSUER_SCHEMA: "https://openprint.art/schemas/issuer/v1.0.json"; export declare const OPEN_PRINT_V1_REGISTRY_EVENT_SCHEMA: "https://openprint.art/schemas/registry-event/v1.0.json"; type DeepReadonlyV1 = T extends (...args: never[]) => unknown ? T : T extends readonly (infer Item)[] ? readonly DeepReadonlyV1[] : T extends object ? { readonly [Key in keyof T]: DeepReadonlyV1; } : T; export type V1CertificateClaims = { schema: typeof OPEN_PRINT_V1_CERTIFICATE_SCHEMA; schemaVersion: typeof OPEN_PRINT_V1_VERSION; id: string; editionId: string; workId: string; artworkTitle: string; collector: V1CollectorClaims; issuer: { id: string; name: string; }; issuedAt: string; sequence: number; license: { id: string; summary: string; }; source: { gitCommit: string; manifestDigest: string; }; notice: string; }; export type V1Certificate = DeepReadonlyV1<{ claims: V1CertificateClaims; integrity: { algorithm: "SHA-256"; canonicalization: "open-print-c14n-1"; digest: string; scope: "claims"; }; signature: { algorithm: "Ed25519"; keyId: string; createdAt: string; value: string; scope: "claims, integrity, and signature metadata"; }; }>; export type V1IssuerPublicKey = { kty: "OKP"; crv: "Ed25519"; x: string; key_ops: ["verify"]; ext: true; }; export type V1IssuerRecord = DeepReadonlyV1<{ schema: typeof OPEN_PRINT_V1_ISSUER_SCHEMA; schemaVersion: typeof OPEN_PRINT_V1_VERSION; id: string; name: string; website?: string; keys: Array<{ id: string; algorithm: "Ed25519"; publicKey: V1IssuerPublicKey; status: "active" | "retired" | "revoked"; validFrom: string; validUntil?: string; revokedAt?: string; revocationReason?: string; }>; }>; export type V1RegistryEventPayload = { schema: typeof OPEN_PRINT_V1_REGISTRY_EVENT_SCHEMA; schemaVersion: typeof OPEN_PRINT_V1_VERSION; id: string; type: "issued"; certificateId: string; editionId: string; workId: string; issuerId: string; sequence: number; fingerprint: string; occurredAt: string; previousEventDigest: string | null; } | { schema: typeof OPEN_PRINT_V1_REGISTRY_EVENT_SCHEMA; schemaVersion: typeof OPEN_PRINT_V1_VERSION; id: string; type: "cancelled"; certificateId: string; issuerId: string; reason: string; occurredAt: string; previousEventDigest: string; } | { schema: typeof OPEN_PRINT_V1_REGISTRY_EVENT_SCHEMA; schemaVersion: typeof OPEN_PRINT_V1_VERSION; id: string; type: "superseded"; certificateId: string; replacementCertificateId: string; issuerId: string; reason: string; occurredAt: string; previousEventDigest: string; }; export type V1RegistryEvent = DeepReadonlyV1; export type V1IssuerSigningContext = { issuer: V1IssuerRecord; privateKey: CryptoKey; keyId: string; signedAt?: string; }; export type V1VerificationCheck = { code: "structure" | "integrity" | "issuer" | "signature" | "registry" | "status"; status: "pass" | "fail" | "not_checked"; message: string; }; export type V1VerificationReport = DeepReadonlyV1<{ status: "valid" | "invalid" | "untrusted" | "cancelled" | "superseded"; fingerprint: string | null; checks: V1VerificationCheck[]; assurance: typeof OPEN_PRINT_V1_VERIFICATION_ASSURANCE; }>; export type V1RegistryVerificationReport = DeepReadonlyV1<{ valid: boolean; trusted: boolean; errors: string[]; warnings: string[]; }>; export declare function generateV1IssuerKeyPair(): Promise; export declare function exportV1IssuerPublicKey(publicKey: CryptoKey): Promise; export declare function importV1IssuerPublicKey(publicKey: JsonWebKey | V1IssuerRecord["keys"][number]["publicKey"]): Promise; export declare function signV1Certificate(claims: V1CertificateClaims, privateKey: CryptoKey, options: { keyId: string; createdAt?: string; }): Promise; export declare function getV1CertificateFingerprint(certificate: V1Certificate): `sha256:${string}`; export declare function isV1IssuerKeyTrustedAt(key: V1IssuerRecord["keys"][number], signedAt: string): boolean; export declare function isV1IssuerKeyActiveAt(key: V1IssuerRecord["keys"][number], signedAt: string): boolean; export declare function verifyV1Certificate(certificate: V1Certificate, options?: { issuer?: V1IssuerRecord; registry?: readonly V1RegistryEvent[]; }): Promise; export declare function verifyV1Registry(events: readonly V1RegistryEvent[], options?: { issuers?: readonly V1IssuerRecord[]; }): Promise; export type V1IssuanceAppendInput = { id: string; signing: V1IssuerSigningContext; occurredAt?: string; }; export type V1RegistryWriter = { readonly events: readonly V1RegistryEvent[]; appendIssuance(certificate: V1Certificate, input: V1IssuanceAppendInput): Promise; }; export declare function createV1RegistryWriter(events: readonly V1RegistryEvent[], issuers: readonly V1IssuerRecord[]): Promise; export declare function appendV1Issuance(certificate: V1Certificate, events: readonly V1RegistryEvent[], input: { id: string; signing: V1IssuerSigningContext; trustedIssuers?: readonly V1IssuerRecord[]; occurredAt?: string; }): Promise; export declare function appendV1Cancellation(events: readonly V1RegistryEvent[], input: { id: string; certificateId: string; reason: string; signing: V1IssuerSigningContext; trustedIssuers?: readonly V1IssuerRecord[]; occurredAt?: string; }): Promise; export declare function appendV1Supersession(events: readonly V1RegistryEvent[], input: { id: string; certificateId: string; replacementCertificateId: string; reason: string; signing: V1IssuerSigningContext; trustedIssuers?: readonly V1IssuerRecord[]; occurredAt?: string; }): Promise; export {}; //# sourceMappingURL=v1.d.ts.map