Skip to main content

trustless_protocol/
lib.rs

1//! Protocol types, codec, handler trait, and client for the Trustless key provider protocol.
2//!
3//! This crate implements the communication protocol between the Trustless proxy and
4//! key provider processes. Key providers hold TLS private keys and perform signing
5//! operations on behalf of the proxy, communicating over stdin/stdout with
6//! length-delimited JSON messages.
7//!
8//! # For key provider implementors
9//!
10//! Implement the [`handler::Handler`] trait and call [`handler::run`] to start
11//! the event loop. See `trustless-provider-stub` for a complete example.
12//!
13//! # For proxy internals
14//!
15//! Use [`client::ProviderClient`] to communicate with a spawned provider process.
16
17/// Async client for communicating with a key provider process.
18pub mod client;
19/// Length-delimited codec for framing and serializing messages.
20pub mod codec;
21/// Error types for protocol operations.
22pub mod error;
23/// Handler trait and event loop for implementing key providers.
24pub mod handler;
25/// Protocol message types (requests, responses, parameters, results).
26pub mod message;
27/// Signature scheme name parsing and algorithm mapping.
28pub mod scheme;
29
30/// Shared helpers for key provider implementations (cert loading, SAN extraction, signing).
31///
32/// Gated behind the `provider-helpers` feature flag.
33#[cfg(feature = "provider-helpers")]
34pub mod provider_helpers;