Skip to content
Live demo →

Quick start

Every language does the same thing: one request, a policy (default hybrid), and a result that tells you the negotiated key exchange and whether it was post-quantum. Pick your language once; the tabs stay in sync across the site.

  1. Build the library and start the demo server.

    Terminal window
    cd mvp
    cargo build --release
    ./target/release/unicomm server --demo-insecure # :8443 hybrid, :8446 pq-required, :8444 classical (demo only), :8088 plain (demo only)

    The first run creates a local CA in mvp/certs/ca.pem. The examples below pass it as ca.pem. Or skip the local server and use the public demo at muthuishere.website, which has a real certificate (leave the CA out).

  2. Make a request.

    // Cargo.toml: unicomm_core = { package = "pq-mvp", path = "../unicomm/mvp" }
    fn main() {
    // Same options and result as the C ABI's uni_request_json. Blocking call.
    let r = unicomm_core::ffi::request_value(
    r#"{"url":"https://localhost:8443/","policy":"hybrid","ca_path":"certs/ca.pem"}"#,
    );
    println!("{} {} post_quantum={}", r["status"], r["key_exchange"], r["post_quantum"]);
    // on failure r["ok"] is false and r["error_code"] is one of the stable codes
    }
  3. Read the result. Every response carries key_exchange (for example X25519MLKEM768), cipher, protocol (HTTP/1.1, HTTP/2 or HTTP/3), the policy and post_quantum. Under hybrid a classical fallback gives post_quantum = false. Under pq-required it is an error (PQ_REQUIRED) instead. HTTP 4xx and 5xx are not errors; they come back as responses.