Expand description
A thin client for sending and receiving messages via a Katzenpost mix network.
This crate provides a thin client library for interacting with a Katzenpost mixnet, suitable for desktop and mobile applications.
A mix network is a type of anonymous communications network. What’s a thin client library? It’s code you can use as a dependency in your application so that it can interact with services on the mix network. The Katzenpost client daemon is a multiplexing client; many applications on the same device can use their thin client libraries to connect to the daemon and interact with mixnet services concurrently.
§See Also
Re-exports§
pub use crate::core::ThinClient;pub use crate::core::EventSinkReceiver;pub use crate::core::DirectoryAuthority;pub use crate::error::ThinClientError;pub use crate::helpers::find_services;pub use crate::helpers::pretty_print_pki_doc;pub use crate::pigeonhole::TombstoneRangeResult;pub use crate::pigeonhole::StartResendingResult;pub use crate::transport::DialConfig;pub use crate::transport::DialConfigError;pub use crate::transport::Dialer;pub use crate::transport::TcpDialConfig;pub use crate::transport::UnixDialConfig;
Modules§
- core
- This module provides the main ThinClient struct and core functionality for connecting to the client daemon, managing events, and sending messages.
- error
- helpers
- Helper functions for working with PKI documents and service discovery.
- persistent
- High-level Pigeonhole API with database persistence.
- pigeonhole
- Pigeonhole protocol API for the thin client.
- transport
- Transport abstraction for the Rust thin-client.
Structs§
- Config
- Our configuration defines some callbacks which the thin client will envoke when it receives the corresponding event from the client daemon.
- Config
File - Geometry
- Pigeonhole
Geometry - PigeonholeGeometry describes the geometry of a Pigeonhole envelope.
- Service
Descriptor - ServiceDescriptor is used when we are searching the PKI document for a specific service.
Constants§
- THIN_
CLIENT_ CAPABILITY_ ALREADY_ IN_ USE - ThinClientCapabilityAlreadyInUse indicates that the provided capability is already in use.
- THIN_
CLIENT_ ERROR_ BACAP_ DECRYPTION_ FAILED - ThinClientErrorBACAPDecryptionFailed indicates that BACAP decryption failed. This occurs when the BACAP payload cannot be decrypted or signature verification fails.
- THIN_
CLIENT_ ERROR_ CHANNEL_ NOT_ FOUND - ThinClientErrorChannelNotFound indicates that the specified channel does not exist or has been garbage collected.
- THIN_
CLIENT_ ERROR_ CONNECTION_ LOST - ThinClientErrorConnectionLost indicates that the connection to the daemon was lost during the operation. The client should attempt to reconnect.
- THIN_
CLIENT_ ERROR_ COURIER_ CACHE_ CORRUPTION - ThinClientErrorCourierCacheCorruption indicates that the courier’s cache has detected corruption.
- THIN_
CLIENT_ ERROR_ DUPLICATE_ CAPABILITY - ThinClientErrorDuplicateCapability indicates that the provided capability (read or write cap) has already been used and is considered a duplicate.
- THIN_
CLIENT_ ERROR_ INTERNAL_ ERROR - ThinClientErrorInternalError indicates an internal error occurred within the client daemon or thin client that prevented operation completion.
- THIN_
CLIENT_ ERROR_ INVALID_ CHANNEL - ThinClientErrorInvalidChannel indicates that the specified channel ID is invalid or malformed.
- THIN_
CLIENT_ ERROR_ INVALID_ PAYLOAD - ThinClientErrorInvalidPayload indicates that the message payload was invalid, too large, or otherwise could not be processed.
- THIN_
CLIENT_ ERROR_ INVALID_ READ_ CAPABILITY - ThinClientErrorInvalidReadCapability indicates that the provided read capability is invalid.
- THIN_
CLIENT_ ERROR_ INVALID_ REQUEST - ThinClientErrorInvalidRequest indicates that the request format was invalid or contained malformed data that could not be processed.
- THIN_
CLIENT_ ERROR_ INVALID_ RESUME_ READ_ CHANNEL_ REQUEST - ThinClientErrorInvalidResumeReadChannelRequest indicates that the provided ResumeReadChannel request is invalid.
- THIN_
CLIENT_ ERROR_ INVALID_ RESUME_ WRITE_ CHANNEL_ REQUEST - ThinClientErrorInvalidResumeWriteChannelRequest indicates that the provided ResumeWriteChannel request is invalid.
- THIN_
CLIENT_ ERROR_ INVALID_ TOMBSTONE_ SIG - ThinClientErrorInvalidTombstoneSig indicates that a replica claimed a box is tombstoned but the signature verification failed (forgery or corruption).
- THIN_
CLIENT_ ERROR_ INVALID_ WRITE_ CAPABILITY - ThinClientErrorInvalidWriteCapability indicates that the provided write capability is invalid.
- THIN_
CLIENT_ ERROR_ MAX_ RETRIES - ThinClientErrorMaxRetries indicates that the maximum number of retry attempts was exceeded for a reliable operation (such as ARQ).
- THIN_
CLIENT_ ERROR_ MKEM_ DECRYPTION_ FAILED - ThinClientErrorMKEMDecryptionFailed indicates that MKEM decryption failed. This occurs when the MKEM envelope cannot be decrypted with any of the replica keys.
- THIN_
CLIENT_ ERROR_ PERMISSION_ DENIED - ThinClientErrorPermissionDenied indicates that the operation was denied due to insufficient permissions or capability restrictions.
- THIN_
CLIENT_ ERROR_ SERVICE_ UNAVAILABLE - ThinClientErrorServiceUnavailable indicates that the requested service or functionality is currently unavailable.
- THIN_
CLIENT_ ERROR_ START_ RESENDING_ CANCELLED - ThinClientErrorStartResendingCancelled indicates that a StartResendingEncryptedMessage or StartResendingCopyCommand operation was cancelled before completion.
- THIN_
CLIENT_ ERROR_ TIMEOUT - ThinClientErrorTimeout indicates that the operation timed out before completion. This may occur during network operations or when waiting for responses from the mixnet.
- THIN_
CLIENT_ IMPOSSIBLE_ HASH_ ERROR - ThinClientImpossibleHashError indicates that the provided hash is impossible to compute, such as when the hash of a write capability is provided but the write capability itself is not provided.
- THIN_
CLIENT_ IMPOSSIBLE_ NEW_ STATEFUL_ WRITER_ ERROR - ThinClientImpossibleNewStatefulWriterError indicates that the daemon was unable to create a new stateful writer.
- THIN_
CLIENT_ IMPOSSIBLE_ NEW_ WRITE_ CAP_ ERROR - ThinClientImpossibleNewWriteCapError indicates that the daemon was unable to create a new write capability.
- THIN_
CLIENT_ PROPAGATION_ ERROR - ThinClientPropagationError indicates that the request could not be propagated to replicas.
- THIN_
CLIENT_ SUCCESS - ThinClientSuccess indicates that the operation completed successfully with no errors. This is the default success state.
Functions§
- thin_
client_ error_ to_ string - Converts a thin client error code to a human-readable string. This function provides consistent error message formatting across the thin client protocol and is used for logging and error reporting.