///
import { AnnotatedKey } from "./AnnotatedKey";
import { BossObject } from "uparsecjs";
import { AnnotatedKeyring } from "./AnnotatedKeyring";
/**
* Shared box allow encrypt its content with any number of keys so any of them allow to access its content.
* It is possible to add more keys to existing SharedBox if it is new or unlocked.
*/
export declare class SharedBox {
#private;
private readonly accessors;
private encryptedPayload?;
/**
* It thrown when it is not possible to unlock the box with a given keyring
*/
static Exception: {
new (message?: string | undefined): {
name: string;
message: string;
stack?: string | undefined;
};
captureStackTrace(targetObject: object, constructorOpt?: Function | undefined): void;
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
stackTraceLimit: number;
};
private packedAccessors;
private constructor();
private get accessKey();
private initializeAsNew;
addKeys(...keys: AnnotatedKey[]): Promise;
private _cachedPayload?;
get payloadPromise(): Promise;
/**
* Await and deserialize payload (that should be [MapSerializer] serialized therefore).
*/
deserialize(): Promise;
setPayload(value: Uint8Array): Promise;
/**
* Unlock the shared box using keys from a ring or throw exception.
* @param keyRing where to get keys to try
* @return self, unlocked
* @throws SharedBox.Exception if no one key in the ring opens the box
*/
unlockWithRing(keyRing: AnnotatedKeyring): Promise;
/**
* Unlock the shared box using keys from a ring or throw exception.
* @param keys to try to unlock with
* @return self, unlocked
* @throws SharedBox.Exception if no one key in the ring opens the box
*/
unlockWithKeys(...keys: AnnotatedKey[]): Promise;
toMap(): Promise;
pack(): Promise;
static fromMap(source: BossObject): Promise;
static unpack(source: Uint8Array): Promise;
static createWith(payload: any): Promise;
static createWithPacked(data: Uint8Array): Promise;
}