Documentation
    Preparing search index...

    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 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 objects 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>

    • Get derived keys from the given services.

      Parameters

      • __namedParameters: {
            id: string;
            kemType?: KemType;
            sessionKey: SessionKey;
            threshold: number;
            txBytes: Uint8Array;
        }

      Returns Promise<Map<string, DerivedKey>>

      • Derived keys for the given services that are in the cache as a "service object ID" -> derived key map. If the call is succesful, exactly threshold keys will be returned.
    • Returns Promise<Map<string, KeyServer>>

    • Parameters

      • options: SealClientExtensionOptions

      Returns { name: "seal"; register: (client: SealCompatibleClient) => SealClient }