/** * The dedicated Ed25519 ledger signing key and its pluggable providers. * * The private key lives only inside a `LedgerSigningKey` private field. It has * no accessor, and JSON serialization and inspection show the public key only, * so it cannot reach records, errors or output by accident. * * Providers: * - `credentialStoreKeyProvider`: the host secret service through the * configurable credential store (`src/auth/credential-store.ts`). This is the * production provider. * - `environmentTestKeyProvider`: a key injected through * `AIWG_EFFECT_LEDGER_TEST_KEY`, honoured only under a test runner or CI. * - `staticKeyProvider`: an in-process key object, for embedding hosts and tests. */ import { type KeyObject } from 'node:crypto'; import { inspect } from 'node:util'; import { type CommandRunner, type SecretStore } from '../auth/credential-store.js'; export declare const DEFAULT_LEDGER_KEY_SERVICE = "effects.aiwg.io"; export declare const LEDGER_TEST_KEY_ENV = "AIWG_EFFECT_LEDGER_TEST_KEY"; export declare class LedgerSigningKey { #private; readonly keyid: string; /** Standard base64 of the DER SubjectPublicKeyInfo. */ readonly publicKey: string; constructor(privateKey: KeyObject); /** Signature (standard padded base64) over the DSSE PAE of `payloadType` and `payload`. */ signPae(payloadType: string, payload: Uint8Array): string; toJSON(): { keyid: string; publicKey: string; }; [inspect.custom](): string; } export interface LedgerKeyProvider { /** A non-secret label for diagnostics. */ readonly name: string; load(): Promise; } /** Parse a PKCS#8 PEM, base64 PKCS#8 DER, or 32-byte hex seed into an Ed25519 key. */ export declare function parseLedgerPrivateKey(secret: string): KeyObject; /** Generate a fresh Ed25519 ledger key, serialized as base64 PKCS#8 DER for a secret store. */ export declare function generateLedgerKeySecret(): string; export declare function staticKeyProvider(privateKey: KeyObject | string, name?: string): LedgerKeyProvider; export interface CredentialStoreKeyProviderOptions { /** Secret-store account naming this ledger key, for example `ledger//`. */ account: string; /** Secret-store service. Defaults to `effects.aiwg.io`, distinct from the release credential. */ service?: string; /** Generate and store a new key when none exists. Off by default. */ provisionIfMissing?: boolean; platform?: NodeJS.Platform; runner?: CommandRunner; /** Explicit mode-0600 file fallback. */ useFile?: boolean; allowFile?: boolean; pathname?: string; /** Inject a store directly (tests, embedding hosts). */ store?: SecretStore; } /** The production provider: the host secret service through the configurable credential store. */ export declare function credentialStoreKeyProvider(options: CredentialStoreKeyProviderOptions): LedgerKeyProvider; /** Tests and CI only: a key injected through `AIWG_EFFECT_LEDGER_TEST_KEY`. */ export declare function environmentTestKeyProvider(env?: NodeJS.ProcessEnv): LedgerKeyProvider; //# sourceMappingURL=keys.d.ts.map