LVE SDK
    Preparing search index...

    Function createLveFile

    • Encrypts data and produces a .lve binary container.

      Generates a random DEK (AES-256-GCM), derives a KEK for each credential via HKDF-SHA-256 over the PRF output, wraps the DEK with AES-KW per recipient, and stores everything in the .lve header alongside the AES-GCM ciphertext.

      Parameters

      • options: CreateOptions

        Plaintext, RP ID, and at least one credential with PRF output.

      Returns Promise<ArrayBuffer>

      ArrayBuffer containing the complete .lve binary.

      LvePrfNotSupportedError if credentials is empty or a PRF output is not exactly 32 bytes.

      const authResult = await authenticateWithPrf({ rpId, fileId });

      const lveBytes = await createLveFile({
      plaintext: new TextEncoder().encode("secret"),
      rpId: window.location.hostname,
      fileId: authResult.fileId,
      credentials: [{ credentialId: authResult.credentialId, prfOutput: authResult.prfOutput }],
      });