import { GuidV4Uint8Array, Member, PlatformID } from '@digitaldefiance/ecies-lib'; import { MemberStatusType } from '../../enumerations/memberStatusType'; /** * Metadata for a BrightTrust member */ export interface BrightTrustMemberMetadata { name: string; email?: string; role?: string; } /** * A BrightTrust member with their public key and metadata * @template TID - Platform ID type (string, Uint8Array, or Buffer-based types) */ export interface IBrightTrustMember { id: TID; publicKey: Uint8Array; metadata: BrightTrustMemberMetadata; isActive: boolean; /** Member status for access control (banned/suspended checks). Defaults to Active. */ status?: MemberStatusType; createdAt: Date; updatedAt: Date; } /** * A share provided by a member for unsealing * @template TID - Platform ID type (string, Uint8Array, or Buffer-based types) */ export interface MemberShare { memberId: TID; decryptedShare: string; } /** * Result of a document sealing operation * @template TID - Platform ID type (string, Uint8Array, or Buffer-based types) */ export interface SealedDocumentResult { documentId: TID; encryptedData: Uint8Array; memberIds: TID[]; sharesRequired: number; createdAt: Date; } /** * Information about a sealed BrightTrust document * @template TID - Platform ID type (string, Uint8Array, or Buffer-based types) */ export interface BrightTrustDocumentInfo { id: TID; memberIds: TID[]; sharesRequired: number; createdAt: Date; creatorId: TID; } /** * Result of checking if a document can be unlocked * @template TID - Platform ID type (string, Uint8Array, or Buffer-based types) */ export interface CanUnlockResult { canUnlock: boolean; sharesProvided: number; sharesRequired: number; missingMembers: TID[]; } /** * Interface for BrightTrust service operations. * Provides member management and document sealing/unsealing functionality * using Shamir's Secret Sharing for secure multi-party access control. */ export interface IBrightTrustService { /** * Add a new member to the BrightTrust * @param member - The member to add (must have public key) * @param metadata - Metadata for the member * @returns The created BrightTrust member record */ addMember(member: Member, metadata: BrightTrustMemberMetadata): Promise>; /** * Remove a member from the BrightTrust. * Note: This does not affect their ability to participate in unsealing * existing documents they are part of. * @param memberId - The ID of the member to remove */ removeMember(memberId: TID): Promise; /** * Get a member by their ID * @param memberId - The ID of the member to retrieve * @returns The member record, or null if not found */ getMember(memberId: TID): Promise | null>; /** * List all active members in the BrightTrust * @returns Array of all active BrightTrust members */ listMembers(): Promise[]>; /** * Seal a document so it can only be accessed when enough BrightTrust members agree. * @param agent - The member performing the sealing operation * @param document - The document to seal * @param memberIds - IDs of members who will receive shares * @param sharesRequired - Number of shares required to unseal (defaults to all members) * @returns The sealed document result */ sealDocument(agent: Member, document: T, memberIds: TID[], sharesRequired?: number): Promise>; /** * Unseal a document using member shares. * @param documentId - The ID of the document to unseal * @param membersWithPrivateKey - Members with loaded private keys for decryption * @returns The unsealed document */ unsealDocument(documentId: TID, membersWithPrivateKey: Member[]): Promise; /** * Get information about a sealed document * @param documentId - The ID of the document * @returns Document information, or null if not found */ getDocument(documentId: TID): Promise | null>; /** * List all documents, optionally filtered by member * @param memberId - Optional member ID to filter by * @returns Array of document information */ listDocuments(memberId?: TID): Promise[]>; /** * Delete a sealed document * @param documentId - The ID of the document to delete */ deleteDocument(documentId: TID): Promise; /** * Check if a set of members can unlock a document * @param documentId - The ID of the document * @param memberIds - IDs of members who would provide shares * @returns Result indicating if unlock is possible */ canUnlock(documentId: TID, memberIds: TID[]): Promise>; } //# sourceMappingURL=brightTrustService.d.ts.map