Files
wolfssl/wrapper/CSharp
Daniele Lacamera 2bfd0277c5 Remove liboqs dependency
Falcon was the last algorithm backed by liboqs; now that wolfCrypt has a
native Falcon implementation, liboqs is no longer needed. Remove the
integration entirely so liboqs does not appear as a build or SBOM dependency:

  - configure: drop --with-liboqs (and the -loqs link), the BUILD_LIBOQS
    conditional and the summary line.
  - CMake: drop WOLFSSL_OQS, the duplicate liboqs-backed WOLFSSL_FALCON
    option, the OQS cross-validation / find_package(OQS) block, the
    FindOQS.cmake module, BUILD_OQS_HELPER, and HAVE_LIBOQS from options.h.in.
  - Remove the wolfcrypt/src/port/liboqs port layer (liboqs.c/.h) and its
    wolfSSL_liboqsInit/Close calls in wc_port.c.
  - settings.h: drop HAVE_LIBOQS from the asym key import/export aggregates
    (HAVE_FALCON already covers them) and from the experimental gate; add
    HAVE_FALCON to the experimental gate so the unstandardized Falcon requires
    WOLFSSL_EXPERIMENTAL_SETTINGS in every build system.
  - Drop liboqs.c from the VS/Zephyr/INTIME project files, remove the liboqs
    install from Docker, and update INSTALL/tls.c text (Falcon is native now).

No functional change to non-Falcon builds; the library links no liboqs.
2026-07-08 18:40:53 +02:00
..
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2026-02-18 09:52:21 -07:00
2024-10-05 11:44:58 -07:00
2024-10-05 11:44:58 -07:00
2026-07-08 18:40:53 +02:00

wolfSSL CSharp Wrappers

This directory contains the CSharp wrapper for the wolfSSL TLS layer with examples.

  • wolfSSL_CSharp: wolfSSL TLS layer wrappers (library).
  • wolfCrypt-Test: wolfCrypt layer wrapper testing.
  • user_settings.h: wolfCrypt wrapper user settings.

Examples:

  • wolfSSL-DTLS-PSK-Server
  • wolfSSL-DTLS-Server
  • wolfSSL-Example-IOCallbacks
  • wolfSSL-TLS-Client
  • wolfSSL-TLS-PSK-Client
  • wolfSSL-TLS-PSK-Server
  • wolfSSL-TLS-Server
  • wolfSSL-TLS-ServerThreaded

Windows

A Visual Studio solution wolfSSL_CSharp.sln is provided. This will allow you to build the wrapper library and examples. It includes the wolfSSL Visual Studio project directly.

To successfully run and build the solution on Windows Visual Studio you will need to open a new solution wolfSSL_CSharp.sln located in wrapper\CSharp\wolfSSL_CSharp.sln.

Select the CPU type, configuration, and target file. select Build and either Rebuild Solution or Build Solution.

Linux (Ubuntu) using mono

Prerequisites for linux:

apt-get update
apt-get upgrade
apt-get install mono-complete

Build wolfSSL and install

System-wide install

./autogen.sh
cp wrapper/CSharp/user_settings.h .
./configure --enable-usersettings
make
make check
sudo make install

Local-only install (no sudo required)

./autogen.sh
cp wrapper/CSharp/user_settings.h .
./configure --enable-usersettings --prefix=$(pwd)/install
make
make install

Build and run the wolfCrypt test wrapper

From the wrapper/CSharp directory (cd wrapper/CSharp):

Compile wolfCrypt test:

mcs wolfCrypt-Test/wolfCrypt-Test.cs wolfSSL_CSharp/wolfCrypt.cs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs -OUT:wolfcrypttest.exe

Run with system-wide install:

mono wolfcrypttest.exe

Run with local-only install. The compile step above produced wolfcrypttest.exe inside wrapper/CSharp/; this run command is invoked from the wolfSSL project root so the relative paths line up:

LD_LIBRARY_PATH=./install/lib mono wrapper/CSharp/wolfcrypttest.exe

Build and run the wolfSSL client/server test

From the wrapper/CSharp directory (cd wrapper/CSharp):

Compile server:

mcs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs wolfSSL-TLS-Server/wolfSSL-TLS-Server.cs -OUT:server.exe

Compile client:

mcs wolfSSL_CSharp/wolfCrypt.cs wolfSSL-TLS-Client/wolfSSL-TLS-Client.cs wolfSSL_CSharp/wolfSSL.cs wolfSSL_CSharp/X509.cs -OUT:client.exe

Run the example

In one terminal instance run the server:

mono server.exe

And in another terminal instance run the client:

mono client.exe

Enabling SNI

To enable SNI, just pass the -S argument with the specified hostname to the client:

mono client.exe -S hostname

And run the server with the -S flag:

mono server.exe -S