Crates.io | threema-gateway |
lib.rs | threema-gateway |
version | 0.18.0 |
source | src |
created_at | 2016-12-15 19:44:50.250986 |
updated_at | 2024-07-13 21:18:31.49021 |
description | A client library for the Threema Gateway. |
homepage | |
repository | https://github.com/dbrgn/threema-gateway-rs |
max_upload_size | |
id | 7606 |
size | 171,925 |
This is a mostly-complete implementation of an asynchronous Threema Gateway client library in Rust. For implementation status, see feature list below.
Sending
Encrypting
Lookup
Receiving
Files
Upload files
Download files
Take a look at the examples in the examples/
directory to see how they're
implemented.
Generate a new keypair:
cargo run --example generate_keypair
Lookup public key:
cargo run --example lookup_pubkey -- <our_id> <secret> <their_id>
Send simple transport-encrypted encrypted message:
cargo run --example send_simple -- <from> id <to-id> <secret> <text>...
cargo run --example send_simple -- <from> email <to-email> <secret> <text>...
cargo run --example send_simple -- <from> phone <to-phone> <secret> <text>...
Send e2e encrypted message:
cargo run --example send_e2e_text -- <from> <to> <secret> <private-key> <text>...
Look up Threema ID by phone:
cargo run --example lookup_id -- by_phone <from> <secret> 41791234567
Look up Threema ID by email hash:
cargo run --example lookup_id -- by_email_hash <from> <secret> 1ea093239cc5f0e1b6ec81b866265b921f26dc4033025410063309f4d1a8ee2c
Decode and decrypt an incoming message payload:
cargo run --example receive -- <our-id> <secret> <private-key> <request-body>
Download a blob:
cargo run --example download_blob -- <our-id> <secret> <private-key> <blob-id>
This library offers the following optional features:
receive
: Add support for processing incoming messages. Enabled by default.
This library generally tracks the latest stable Rust version but tries to guarantee backwards compatibility with older stable versions as much as possible. However, in many cases transitive dependencies make guaranteeing a minimal supported Rust version impossible (see this discussion).
This library uses rustls with native (system-provided) root certificates to establish a TLS connection.
Licensed under either of
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.