import type { HexString } from '../binary.js'; import type { BackoffConfig } from '../retry.js'; import type { XwingKeypair } from './xwing.js'; /** * Options for attested methods when no reencrypt keys are provided. * The KMS generates an ephemeral keypair and returns plaintext. */ export type AttestedOptsEphemeral = { reencryptPubKey?: never; reencryptKeypair?: never; backoffConfig?: Partial; }; /** * Options for attested methods when only a reencrypt public key is provided. * The KMS encrypts the result under the provided key; caller receives ciphertext. */ export type AttestedOptsEncrypted = { reencryptPubKey: Uint8Array; reencryptKeypair?: never; backoffConfig?: Partial; }; /** * Options for attested methods when both a reencrypt key and keypair are provided. * The KMS reencrypts under the public key; the SDK decrypts locally using the keypair. */ export type AttestedOptsDecrypted = { reencryptPubKey: Uint8Array; reencryptKeypair: XwingKeypair; backoffConfig?: Partial; }; /** Union of all valid opts for attestedDecrypt / attestedCompute. */ export type AttestedOpts = AttestedOptsEphemeral | AttestedOptsEncrypted | AttestedOptsDecrypted; /** Extends the base opts with voucher-specific fields for WithVoucher methods. */ export type AttestedWithVoucherOptsEphemeral = AttestedOptsEphemeral & { requesterArgData?: HexString; }; export type AttestedWithVoucherOptsEncrypted = AttestedOptsEncrypted & { requesterArgData?: HexString; }; export type AttestedWithVoucherOptsDecrypted = AttestedOptsDecrypted & { requesterArgData?: HexString; }; export type AttestedWithVoucherOpts = AttestedWithVoucherOptsEphemeral | AttestedWithVoucherOptsEncrypted | AttestedWithVoucherOptsDecrypted; /** Options for attestedReveal. */ export type AttestedRevealOpts = { backoffConfig?: Partial; };