qopanza (Rust)
Async Rust client for the Qopanza API.
Install
[]
= { = "../sdks/rust" }
= { = "1", = ["macros", "rt-multi-thread"] }
Requires Rust 1.75+.
Usage
use Client;
let client = new;
// One-line encryption: no key management at all.
let sealed = client.encrypt.await?;
let opened = client.decrypt.await?;
// Full control.
let key = client.create_key.await?;
let sealed = client.encrypt.await?;
let sig_key = client.create_key.await?;
let signed = client.sign.await?;
let valid = client.verify.await?;
// Discovery.
let run = client.scan_tls.await?;
let posture = client.security_posture.await?;
Run the quickstart against a local server:
QOPANZA_API_KEY=qsk_... QOPANZA_BASE_URL=http://localhost:8000 \
Notes
- Bytes, not base64.
&[u8]/Vec<u8>at the API boundary; base64 is applied internally. verifyreturnsResult<bool, Error>.Ok(false)means the signature did not verify;Errmeans the check could not be performed. Conflating them is how a verification step silently becomes a no-op.- A failed scan has
risk_score: None, not zero. Error::Api { status, detail }keeps the status code separate so a 409 from a revoked key can be handled differently from a 429 rate limit.- TLS via rustls, so there is no OpenSSL build dependency.
This client holds a secret API key, so it belongs server-side.
Tests