Documentation

    Class SealClient

    Index

    Constructors

    Methods

    • Decrypt the given encrypted bytes using cached keys. Calls fetchKeys in case one or more of the required keys is not cached yet. The function throws an error if the client's key servers are not a subset of the encrypted object's key servers (including the same weights) or if the threshold cannot be met.

      Parameters

      • __namedParameters: { data: Uint8Array; sessionKey: SessionKey; txBytes: Uint8Array }

      Returns Promise<Uint8Array<ArrayBufferLike>>

      • The decrypted plaintext corresponding to ciphertext.
    • Return an encrypted message under the identity.

      Parameters

      • __namedParameters: {
            aad?: Uint8Array<ArrayBufferLike>;
            data: Uint8Array;
            demType?: DemType;
            id: string;
            kemType?: KemType;
            packageId: string;
            threshold: number;
        }

      Returns Promise<{ encryptedObject: Uint8Array; key: Uint8Array }>

      The bcs bytes of the encrypted object containing all metadata and the 256-bit symmetric key that was used to encrypt the object. Since the symmetric key can be used to decrypt, it should not be shared but can be used e.g. for backup.

    • Fetch keys from the key servers and update the cache.

      It is recommended to call this function once for all ids of all encrypted obejcts if there are multiple, then call decrypt for each object. This avoids calling fetchKey individually for each decrypt.

      Parameters

      • __namedParameters: {
            ids: string[];
            sessionKey: SessionKey;
            threshold: number;
            txBytes: Uint8Array;
        }

      Returns Promise<void>

    • Returns Promise<KeyServer[]>

    MMNEPVFCICPMFPCPTTAAATR