embedded-mbedtls
An Mbed TLS Rust wrapper for constrained embedded devices.
Currently, this project is developed with no_std CoAPs and LwM2M devices in mind, though usage
is not limited to these use cases. Targeting CoAPs and LwM2M, it uses a static Mbed TLS configuration:
- DTLS support
- (D)TLS 1.2
- Client-only
TLS_PSK_WITH_AES_128_CCM_8cipher suite support- CTR_DRBG pseudo-random number generator support
In the future, a dynamic configuration using Rust features might be implemented, but there is currently no roadmap to do so.
Platform abstraction
- Networking with
embedded_nal - Timing with
embedded_timers - Random Number Generation with
rand_core
Usage Example
In addition to the following example code, also have a look at the example directory in the
git repository. Due to the strong focus on no_std environments, the repository contains
working examples for no_std hardware.
use ;
use block;
// Assuming the variables in use contain a valid hardware abstraction and the server address
// Create the hardware context
let mut ctx = new_udp_client_side;
// Create and configure the connection instance
let mut connection = new_dtls_client.unwrap;
connection
.configure_psk
.unwrap;
// Set up connection
block!.unwrap;
// Send data
block!.unwrap;
// Receive data
let mut buf = ;
let len = block!.unwrap;
// Close connection
block!.unwrap;
Features
alloc: enables use of heap allocated contexts, see the explanation inSslConnection
License
Open Logistics License
Version 1.3, January 2023
See the LICENSE file in the top-level directory.
Contact
Fraunhofer IML Embedded Rust Group - embedded-rust@iml.fraunhofer.de