Skip to main content
PHP integrates through the SDK’s C ABI (include/evb_e2ee.h) using the PHP 8 FFI extension. The native library is libevb_e2ee_ffi (built from bindings/dart/rust, or fetched from the repository’s GitHub Releases).

1. Install

evb_e2ee.h ships in the repository (include/evb_e2ee.h) — copy it next to your PHP file.

2. Account key (UMK) — once, on your server

Persist the raw $umk bytes in your secret store (KMS, encrypted vault). Everabyte never receives them.

3. Encrypt → upload → attach envelope

Upload with POST /files/upload/{bucketId} (multipart, filename = $wireName), then POST /e2ee/files/by-path/envelope (bucketId, fileName, encryptedName, envelope fields). Check both responses. On a timeout, reconcile before cleanup. After a confirmed failure, resolve the uploaded row by bucket and opaque wire name, confirm it has no envelope, and hard-delete it through the file API as required by the E2EE upload contract. Handle retention blocks explicitly.

4. Download → decrypt

Error handling: every call returns 0 on success, negative otherwise; read evb_last_error(buf, cap) (call once with null to get the required capacity).

Next