/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { BasicSet, Bytes, Crypto, Timestamp } from "@matter/general"; import type { GroupKeyManagement } from "@matter/types/clusters/group-key-management"; export declare const GROUP_KEY_INFO: AllowSharedBufferSource; export declare class KeySets extends BasicSet { #private; get sessions(): Map; add(item: T): void; delete(itemOrField: T | F, value?: T[F]): boolean; forId(groupKeySetId: number): OperationalKeySet | undefined; /** * Returns whether the given group key set holds an operational key equal to the provided one. Used to resolve group * session id collisions: two key sets with identical key material derive the same session id, so the decrypting key * set may differ from the one a group is mapped to while still carrying the key that authenticated the message. */ containsOperationalKey(keySetId: number, key: Bytes): boolean; /** * Return an operative list of operational keys, start time and their session IDs for a specified * group key set id. This is mainly used for receiving messages. */ allKeysForId(keySetId: number): { key: Bytes; privacyKey?: Bytes; sessionId?: number; startTime: Timestamp; }[]; /** * Returns the current operational group key for a given group KeySet Id and returns the keys, start time and * their session IDs. This is mainly used for sending messages. */ currentKeyForId(keySetId: number): { key: Bytes; privacyKey?: Bytes; sessionId?: number; startTime: Timestamp; }; /** * Returns the group key set for a given group key set id in the official data format from the Group key Management * cluster. */ asGroupKeySet(groupKeySetId: number): { groupKeySetId: number; epochKey0: AllowSharedBufferSource | null; epochStartTime0: number | bigint | null; epochKey1: AllowSharedBufferSource | null; epochStartTime1: number | bigint | null; epochKey2: AllowSharedBufferSource | null; epochStartTime2: number | bigint | null; groupKeySecurityPolicy: GroupKeyManagement.GroupKeySecurityPolicy; } | undefined; /** Calculates a group session id based on the operational group key. */ sessionIdFromKey(crypto: Crypto, operationalGroupKey: Bytes): Promise; } export type GroupKeySet = GroupKeyManagement.GroupKeySet; /** Enhanced structure of GroupKeySet to include operational data for easier operational processing. */ export type OperationalKeySet = GroupKeySet & { operationalEpochKey0: Bytes; operationalPrivacyKey0?: Bytes; groupSessionId0: number | null; operationalEpochKey1: Bytes | null; operationalPrivacyKey1?: Bytes | null; groupSessionId1: number | null; operationalEpochKey2: Bytes | null; operationalPrivacyKey2?: Bytes | null; groupSessionId2: number | null; }; //# sourceMappingURL=KeySets.d.ts.map