/** * @license * @preserve * * KeeeX SAS Public code * https://keeex.me * Copyright 2013-2023 KeeeX All Rights Reserved. * * These computer program listings and specifications, herein, * are and remain the property of KeeeX SAS. The intellectual * and technical concepts herein are proprietary to KeeeX SAS * and may be covered by EU and foreign patents, * patents in process, trade secrets and copyright law. * * These listings are published as a way to provide third party * with the ability to process KeeeX data. * As such, support for public inquiries is limited. * They are provided "as-is", without warrany of any kind. * * They shall not be reproduced or copied or used in whole or * in part as the basis for manufacture or sale of items unless * prior written permission is obtained from KeeeX SAS. * * For a license agreement, please contact: * * */ import * as bundleKeys from "./bundle/keys.js"; import type * as bundleTypes from "./bundle/types.js"; /** A bundle is an encrypted data blob associated with a set of recipients. * * There are two ways to create a bundle: from scratch using `createBundle()` * and by reading a bundle blob. * * It is possible to split a bundle into two separate blob: recipients headers * and data. It is possible to read a bundle with no data (to manipulate the * headers), and to create a partial bundle with only a subset of recipients. */ export declare class Bundle { #private; private constructor(); /** Create a bundle from scratch. * * This is the function that performs almost all the work in preparing a * bundle. */ static createBundle(recipients: bundleKeys.RecipientKey | Array, inputData: bundleTypes.InputData, metadata?: string): Promise; /** Load bundle files to build an in-memory object. * * It is possible to split bundle data in multiple files (headers and data). */ static loadBundle(rawBundleData: Uint8Array | Array): Promise; getMetadata(): string; /** Check if this bundle have actual payload data */ haveData(): boolean; /** * Decode encrypted data * * @param recipientKey - Recipient keypair (with private key) * * @param blockName - The name of the data block to retrieve */ getData(recipientKey: bundleKeys.RecipientKey, blockName?: string): Promise; /** * Save the content of this bundle * * @param limitData - Restrict the output to only the specified block of data names. If not * specified, all blocks are exported. * * @param limitRecipients - Only export the headers matching the given keys. If not specified, all * headers are exported. */ saveBundle(limitData?: Array, limitRecipients?: Array): Promise; /** Add new keys able to decipher the bundle */ addRecipient: (newRecipientKey: Array | bundleKeys.RecipientKey, knownKey: bundleKeys.RecipientKey) => Promise; }