import { type KeyObject } from 'node:crypto';
import type { MarketLicenseFile, MarketLicensePayload, MarketPricing, MarketSigPayload } from '../../typings/ext/market';
/**
 * 官方插件市场 Ed25519 公钥（SPKI DER base64）。
 * 私钥仅保存在插件市场宿主配置 `market.privateKey`，不得打进客户站点 / npm 包对外常量。
 */
export declare const DEFAULT_MARKET_PUBLIC_KEY_B64 = "MCowBQYDK2VwAyEAKAnlQfYBA+ooJQSkjmmYsq+Zx6lTjHLgViX2Yt+gdr0=";
export declare function newMarketId(): string;
export declare function newInstallNonce(): string;
/** 稳定 JSON（键排序），供签名 */
export declare function stableStringify(value: unknown): string;
export declare function resolveMarketPublicKey(override?: string | Uint8Array): KeyObject;
export declare function resolveMarketPrivateKey(privateKey: string | Uint8Array): KeyObject;
export declare function ed25519Sign(data: string | Buffer, privateKey: string | Uint8Array | KeyObject): string;
export declare function ed25519Verify(data: string | Buffer, sigB64: string, publicKey?: string | Uint8Array | KeyObject): boolean;
/** 生成一对 Ed25519（运维轮换密钥用） */
export declare function generateMarketKeyPair(): {
    publicKey: string;
    privateKey: string;
};
export declare function pricingFromPrice(price: number): MarketPricing;
export declare function buildMarketSigPayload(input: {
    marketId: string;
    pricing: MarketPricing;
    version: string;
    key: string;
    contentHash: string;
}): MarketSigPayload;
export declare function signMarketSigPayload(payload: MarketSigPayload, privateKey: string | Uint8Array | KeyObject): string;
export declare function verifyMarketSigPayload(payload: MarketSigPayload, sigB64: string, publicKey?: string | Uint8Array | KeyObject): boolean;
export declare function issueLicenseFile(payload: Omit<MarketLicensePayload, 'v'> & {
    v?: 1;
}, privateKey: string | Uint8Array | KeyObject): MarketLicenseFile;
export declare function parseLicenseFile(raw: string | MarketLicenseFile | object): MarketLicenseFile | null;
export declare function verifyLicenseFile(file: MarketLicenseFile, opts?: {
    publicKey?: string | Uint8Array | KeyObject;
    expectMarketId?: string;
    expectNonce?: string | null;
    now?: Date;
}): boolean;
export declare function sha256Hex(parts: Buffer[]): string;
