/// <reference types="node" />
import { StreamID } from '@streamr/protocol';
import { EthereumAddress } from '@streamr/utils';
import { PersistenceManager } from '../PersistenceManager';
import { StreamrClientEventEmitter } from '../events';
import { LoggerFactory } from '../utils/LoggerFactory';
import { GroupKey } from './GroupKey';
/**
 * @privateRemarks
 *
 * In the client API we use the term EncryptionKey instead of GroupKey.
 * The GroupKey name comes from the protocol. TODO: we could rename all classes
 * and methods to use the term EncryptionKey (except protocol-classes, which
 * should use the protocol level term GroupKey)
 */
export interface UpdateEncryptionKeyOptions {
    /**
     * The Stream ID for which this key update applies.
     */
    streamId: string;
    /**
     * Determines how the new key will be distributed to subscribers.
     *
     * @remarks
     * With `rotate`, the new key will be sent to the stream alongside the next published message. The key will be
     * encrypted using the current key. Only after this will the new key be used for publishing. This
     * provides forward secrecy.
     *
     * With `rekey`, we for each subscriber to fetch the new key individually. This ensures each subscriber's
     * permissions are revalidated before they are given the new key.
     */
    distributionMethod: 'rotate' | 'rekey';
    /**
     * Provide a specific key to be used. If left undefined, a new key is generated automatically.
     */
    key?: GroupKey;
}
export declare class LocalGroupKeyStore {
    private readonly persistenceManager;
    private readonly eventEmitter;
    private readonly logger;
    constructor(persistenceManager: PersistenceManager, eventEmitter: StreamrClientEventEmitter, loggerFactory: LoggerFactory);
    get(keyId: string, publisherId: EthereumAddress): Promise<GroupKey | undefined>;
    /**
     * Legacy keys refer to group keys migrated from a previous version of the client where group keys were not tied
     * to a specific publisherId, therefore any publisherId for a given legacy key id is considered a match.
     *
     * TODO: remove this functionality in the future
     */
    private getLegacyKey;
    set(keyId: string, publisherId: EthereumAddress, data: Buffer): Promise<void>;
    setLatestEncryptionKeyId(keyId: string, publisherId: EthereumAddress, streamId: StreamID): Promise<void>;
    getLatestEncryptionKeyId(publisherId: EthereumAddress, streamId: StreamID): Promise<string | undefined>;
}
