Skip to content

Repository files navigation

libohttp

A minimal Oblivious HTTP (RFC 9458) client core for Kotlin/JVM and Android. Operates on opaque ByteArray payloads. HPKE (RFC 9180) is supplied by a separate backend.

Usage

import org.osservatorionessuno.libohttp.OhttpClient
import org.osservatorionessuno.libohttp.bouncycastle.BouncyCastleHpkeBackend   // from libohttp-hpke-bc

val client = OhttpClient.fromKeyConfig(keyConfigBytes, BouncyCastleHpkeBackend())
val encapsulated = client.encapsulateRequest(bhttpRequestBytes)   // message/ohttp-req body
// POST encapsulated.bytes to the relay (Content-Type: message/ohttp-req), read the response ...
val bhttpResponseBytes = encapsulated.decapsulateResponse(ohttpResBody)

Supported ciphersuite

The mandatory-to-implement suite (RFC 9458 §8.2): KEM 0x0020 DHKEM(X25519, HKDF-SHA256), KDF 0x0001 HKDF-SHA256, AEAD 0x0001 AES-128-GCM (AES-256-GCM 0x0002 also accepted).

About

Java/Kotlin OHTTP client

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages