import { type KeyPair } from "@aithos/protocol-client"; /** * Capability to produce Ed25519 signatures over a fixed key. The key * material itself is not exposed — only the public key (which is, by * definition, public) and the {@link sign} method. * * `sign` returns a Promise even when the underlying * implementation is synchronous (e.g. {@link RawSeedSigner}) so future * implementations backed by `crypto.subtle.sign` can drop in without * breaking callers. */ export interface Signer { /** 32-byte Ed25519 public key. */ readonly publicKey: Uint8Array; /** Sign `message` and return the 64-byte Ed25519 signature. */ sign(message: Uint8Array): Promise; /** Zeroize any private material the signer holds. Idempotent. */ destroy(): void; } /** * Today's implementation: wraps a raw 32-byte Ed25519 seed and signs * via `@noble/ed25519`. Holds the seed in a defensively-copied * Uint8Array bound to a private field, so mutating the constructor * input afterwards does not affect the signer. * * Migration note: when we move to Web Crypto non-extractable keys, * this class is replaced by a `SubtleSigner` that holds a `CryptoKey` * reference and calls `crypto.subtle.sign("Ed25519", key, message)`. * The {@link Signer} interface stays the same, so all callers (the * SessionVault, the auth namespace, the ethos publish path) keep * working unchanged. */ export declare class RawSeedSigner implements Signer { #private; readonly publicKey: Uint8Array; /** * @param seed 32-byte Ed25519 seed (the private half). * @param publicKey 32-byte Ed25519 public key matching `seed`. * Both arrays are defensively copied — the caller may zeroize their * originals immediately. */ constructor(seed: Uint8Array, publicKey: Uint8Array); sign(message: Uint8Array): Promise; destroy(): void; /** * Internal escape hatch for protocol-client interop. Returns a KeyPair * usable with `buildSignedEnvelope({ signer })` and friends, which * today take a raw seed. Marked `_unsafe` because it surfaces the * private seed bytes — only callers within `@aithos/sdk` should use * it, and never propagate the result outside the SDK boundary. * * When protocol-client gains a Signer-shaped API (post-alpha), this * method goes away and SubtleSigner becomes pluggable upstream. * * @internal */ _unsafeKeyPair(): KeyPair; } //# sourceMappingURL=signer.d.ts.map