Skip to main content

Crate katzenpost_thin_client

Crate katzenpost_thin_client 

Source
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.
ConfigFile
Geometry
PigeonholeGeometry
PigeonholeGeometry describes the geometry of a Pigeonhole envelope.
ServiceDescriptor
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.