wolfssl-examples/hsm/dtls_client
Marco Oliverio c586428531
wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555)
* wolfHSM: add DTLS client that uses HSM as cryptographic backend

* address reviewer's comment

* dtls client improvements
2026-07-22 08:37:34 -06:00
..
Makefile wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555) 2026-07-22 08:37:34 -06:00
README.md wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555) 2026-07-22 08:37:34 -06:00
user_settings.h wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555) 2026-07-22 08:37:34 -06:00
wh_dtls_client.c wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555) 2026-07-22 08:37:34 -06:00
wolfhsm_cfg.h wolfHSM: add DTLS client example that uses HSM as cryptographic back end (#555) 2026-07-22 08:37:34 -06:00

README.md

wolfHSM DTLS Client Example

Demonstrates a DTLS client using wolfHSM for cryptographic operations. All private key operations are performed on the HSM - keys never leave the secure environment. The example uses wolfHSM posix server for HSM communication/simulation.

Quick Start

Build

make download_repos   # Clone repos (first time only)
make all              # Build everything

Run (3 separate terminals)

Terminal 1 - Start wolfHSM posix server:

make run_hsm_server

Terminal 2 - Start DTLS server:

make run_dtls_server

Terminal 3 - Run client:

make run_client

Using Existing Repositories

make WOLFSSL_DIR=/path/to/wolfssl WOLFHSM_DIR=/path/to/wolfhsm all

Architecture

+------------------+     TCP      +------------------+
|  DTLS Client     |<------------>|  wolfHSM Server  |
|                  |              |  (crypto ops)    |
+--------+---------+              +------------------+
         | UDP/DTLS
         v
+------------------+
|  DTLS Server     |
|  (application)   |
+------------------+

Makefile Targets

Target Description
download_repos Clone wolfSSL and wolfHSM
all Build everything (default)
run_hsm_server Start wolfHSM server (Terminal 1)
run_dtls_server Start wolfSSL DTLS server (Terminal 2)
run_client Run the DTLS client (Terminal 3)
clean Clean build artifacts
clean_repos Remove cloned repositories

Debug Build

make clean
make DEBUG=1