Skip to main content

flamingo_verifier_client/
lib.rs

1//! Client for the Flamingo Verifier host.
2//!
3//! Opens a WebSocket session, verifies the AWS Nitro attestation document that commits to the
4//! enclave's encryption key, and runs one sealed match over the verified channel. The session
5//! yields a [`ChannelConsumer`] bound to that key; Pontifex checks the commitment, measurements,
6//! signature and freshness.
7//!
8//! ```no_run
9//! use flamingo_verifier_client::{Config, FlamingoVerifierClient, PcrMeasurement};
10//! use flamingo_verifier_sealed_types::Request;
11//!
12//! # async fn example(request: &Request, pcrs: [[u8; 48]; 3]) -> Result<(), Box<dyn std::error::Error>> {
13//! let config = Config::new(
14//!     "https://verifier.example.com",
15//!     vec![(0..).zip(pcrs).map(|(index, value)| PcrMeasurement::new(index, value)).collect()],
16//! )?;
17//! let client = FlamingoVerifierClient::new(config)?;
18//! let session = client.connect().await?;
19//! let result = session.request_match(request).await?;
20//! # Ok(())
21//! # }
22//! ```
23
24#![deny(
25    clippy::all,
26    clippy::pedantic,
27    clippy::nursery,
28    missing_docs,
29    dead_code
30)]
31
32mod client;
33mod config;
34mod error;
35mod session;
36
37pub use client::{FlamingoVerifierClient, VerifiedAssignment, VerifiedMatch, VerifiedMatchResult};
38pub use config::Config;
39pub use error::Error;
40pub use pontifex::{ChannelConsumer, PcrMeasurement};
41pub use session::FlamingoVerifierSession;