@me2em/crypto
    Preparing search index...

    Function publishableBundle

    • Builds a publishable PreKeyBundle from a batch for the server.

      Includes: identity public key + SPK public key + SPK signature + optionally one OTK public key by index.

      Parameters

      • batch: PreKeyBatch

        The PreKeyBatch to extract from.

      • identityPub: Uint8Array

        Recipient's Ed25519 public key.

      • OptionalpickOtkIndex: number

        Optional index of an OTK to include (0-based).

      Returns PreKeyBundle

      PreKeyBundle ready for server upload.

      const bundle = publishableBundle(batch, identityPub, 42);
      // bundle.oneTimePreKeyPublicKey = batch.oneTimePreKeys[42].publicKey