/** * @module keystone/admin/admin-helpers * * Cryptographic derivation and lifecycle helpers for the One-Off Challenge Keystone Admin Review subsystem. */ import { HashAlgorithm } from "@ibgib/helper-gib/dist/helpers/utils-helper.mjs"; import { KeystoneVerb } from "../keystone-constants.mjs"; import { KeystoneIbGib_V1 } from "../keystone-types.mjs"; import { KeystoneProfileName } from "../policy/keystone-profile-builder.mjs"; import { AdminRequestIbGib_V1 } from "./admin-request/index.mjs"; /** * Derives a deterministic, high-entropy challenge secret for an administrative action. * * @param masterSecret - Admin secret or master password. * @param nonce - High-entropy UUID nonce stored on the genesis keystone frame. * @param scope - Administrative domain or scope (e.g. 'exception-keys'). * @param verb - Target action verb (e.g. KeystoneVerb.ACCEPT or KeystoneVerb.REJECT). * @param rounds - Number of KDF key stretching rounds (defaults to DEFAULT_ADMIN_CHALLENGE_KDF_ROUNDS). * @param algorithm - Hash algorithm (defaults to SHA-256). * * Cryptographic Construction: * 1. Compound salt: Hash(scope + "_" + verb + "_" + nonce) * 2. Key stretching: kdf_recursiveSaltWrap(masterSecret, salt, rounds) * * Guarantees: * - Forward secrecy & verb isolation: Knowing `accept` reveals zero information about `reject`. * - Replay proofing: Bound strictly to the unique nonce of the challenge instance. */ export declare function deriveAdminChallengeSecret({ masterSecret, nonce, scope, verb, rounds, algorithm, }: { masterSecret: string; nonce: string; scope: string; verb: KeystoneVerb | string; rounds?: number; algorithm?: HashAlgorithm; }): Promise; export interface CreateAdminChallengeGenesisKeystoneParams { masterSecret: string; adminId?: string; adminRequestIbGib?: AdminRequestIbGib_V1; adminRequestAddr?: string; nonce: string; scope: string; targetIdentifier?: string; applicantDetails?: Record; poolIds?: string[]; expirationUTC?: string; rounds?: number; algorithm?: HashAlgorithm; profileName?: KeystoneProfileName; } /** * Creates a brand-new One-Off Challenge Genesis Keystone ($n=0$) containing * mutually exclusive challenge pools (by default, `accept` and `reject`). * * Employs standard `KeystoneService_V1.genesis` backed by `KeystoneProfileBuilder` * and an ephemeral in-memory space via `createInMemoryTempMetaspaceAndSpace`. */ export declare function createAdminChallengeGenesisKeystone({ masterSecret, adminId, adminRequestIbGib, adminRequestAddr, nonce, scope, targetIdentifier, applicantDetails, poolIds, expirationUTC, rounds, algorithm, profileName, }: CreateAdminChallengeGenesisKeystoneParams): Promise; export interface AdminGenesisKeystoneInfo { adminId: string; genesisKeystone: KeystoneIbGib_V1; tjpGib: string; } export interface CreateAdminChallengeGenesisKeystonesParams { admins: Array<{ id: string; password: string; }>; adminRequestIbGib: AdminRequestIbGib_V1; nonce: string; poolIds?: string[]; expirationUTC?: string; rounds?: number; algorithm?: HashAlgorithm; profileName?: KeystoneProfileName; } /** * Creates individual One-Off Challenge Genesis Keystones for each configured admin, * all targeting the same immutable AdminRequest stone. */ export declare function createAdminChallengeGenesisKeystones({ admins, adminRequestIbGib, nonce, poolIds, expirationUTC, rounds, algorithm, profileName, }: CreateAdminChallengeGenesisKeystonesParams): Promise>; export interface SolveAdminChallengeKeystoneParams { genesisKeystone: KeystoneIbGib_V1; masterSecret: string; poolId: string; adminRequestIbGib?: AdminRequestIbGib_V1; adminRequestAddr?: string; resolutionNotes?: string; } /** * Solves a single target pool on a One-Off Challenge Genesis Keystone, evolving * the keystone to frame $n=1$ with cryptographic proof of resolution. * * Uses standard `KeystoneService_V1.sign` with an ephemeral in-memory metaspace/space. */ export declare function solveAdminChallengeKeystone({ genesisKeystone, masterSecret, poolId, adminRequestIbGib, adminRequestAddr, resolutionNotes, }: SolveAdminChallengeKeystoneParams): Promise; /** * Validates the resolution transition of a challenge keystone from genesis ($n=0$) * to solved frame ($n=1$), checking cryptographic correctness and pool ID matching. * * Runs canonical `validateGenesisKeystone` and `validateKeystoneTransition`. * * @returns Array of validation error strings (empty if resolution is cryptographically valid). */ export declare function verifyAdminChallengeResolution({ genesisKeystone, solvedKeystone, expectedPoolId, expectedTargetAddr, }: { genesisKeystone: KeystoneIbGib_V1; solvedKeystone: KeystoneIbGib_V1; expectedPoolId?: string; expectedTargetAddr?: string; }): Promise; //# sourceMappingURL=admin-helpers.d.mts.map