/** * @module keystone/delegate/delegate-helpers * * Foundational pure helper functions for keystone delegation, secret derivation, * capability detection, expiration evaluation, and sync delegate factory construction. */ import { KeystoneData_V1, KeystoneIbGib_V1 } from "../keystone-types.mjs"; import { CreateSyncDelegateOpts, CreateAuthorDelegateOpts, DelegateKeystoneInfo, KeystoneCapabilities, SsoProviderId } from "./delegate-types.mjs"; /** * Derives a deterministic delegate secret from a masterSecret using KDF. * Salt is the sha512 hash of the masterSecret. * Number of rounds is hardcoded to 1000. */ export declare function deriveDelegateSecret({ masterSecret, }: { masterSecret: string; }): Promise; /** * Generates or derives a high-entropy standalone 512-bit delegate secret for a local device delegate. */ export declare function deriveDeviceDelegateSecret({ primaryTjpAddr, deviceTag, }: { primaryTjpAddr: string; deviceTag?: string; }): Promise; /** * Pure factory function for creating an outward sync delegate keystone. * Handles profile building, frame details injection, config compilation, and genesis. */ export declare function createSyncDelegateKeystone({ profileName, profileTemplate, username, deviceTag, primaryTjpAddr, delegateSecret, custodianReqs, expirationUTC, additionalFrameDetails, metaspace, space, }: CreateSyncDelegateOpts): Promise; /** * Pure factory function for creating an outward author delegate keystone. * Handles profile building, frame details injection, config compilation, and genesis. */ export declare function createAuthorDelegateKeystone({ profileName, profileTemplate, username, deviceTag, primaryTjpAddr, delegateSecret, expirationUTC, additionalFrameDetails, metaspace, space, }: CreateAuthorDelegateOpts): Promise; /** * Checks if a generic keystone identity or frame has expired based on its frameDetails.expirationUTC. */ export declare function isKeystoneExpired({ keystone, nowUTC, }: { keystone: KeystoneIbGib_V1 | null | undefined; nowUTC?: string | number | Date; }): boolean; /** * Checks if a delegate keystone has expired. * Works against either the parent's registered `delegateInfo` OR the `delegateKeystone` itself. */ export declare function isDelegateExpired({ delegateInfo, delegateKeystone, nowUTC, }: { delegateInfo?: DelegateKeystoneInfo | null; delegateKeystone?: KeystoneIbGib_V1 | null; nowUTC?: string | number | Date; }): boolean; /** * Checks if a keystone contains an active custodian challenge pool or origin for the given SSO provider. */ export declare function isSsoProviderLinked({ keystone, aggregatedDetails, providerId, }: { keystone: KeystoneIbGib_V1; aggregatedDetails?: any; providerId: SsoProviderId; }): boolean; /** * Determines whether a delegate registration or delegate keystone represents a custodial / foreign SSO delegate. */ export declare function isCustodialDelegate({ delegateInfo, delegateKeystone, providerId, }: { delegateInfo?: Partial | null; delegateKeystone?: KeystoneIbGib_V1 | null; providerId?: SsoProviderId | string; }): boolean; /** * Inspects a primary keystone to determine its dynamic capabilities (Sovereign, Custodial, Hybrid). */ export declare function getKeystoneCapabilities({ keystone, aggregatedDetails, }: { keystone: KeystoneIbGib_V1; aggregatedDetails?: Partial; }): KeystoneCapabilities; //# sourceMappingURL=delegate-helpers.d.mts.map