5. Integration

In diesem Kapitel erfahren Sie, wie Sie OpenSSL in Ihre .NET-Anwendungen integrieren.


Übersicht

Thema Beschreibung Seite
——-————–——-
P/Invoke DLLs in .NET einbinden 5.1 P/Invoke - DLLs einbinden
Blazor WASM WASM in Browser nutzen blazor-wasm
NuGet Pakete erstellen und nutzen 5.2 NuGet-Grundlagen

Schnellstart

1. DLLs kopieren

# In Ihr .NET-Projektverzeichnis
copy "D:\Projects\openssl-3.6.0\bin\bin\libcrypto-3-x64.dll" .\
copy "D:\Projects\openssl-3.6.0\bin\bin\libssl-3-x64.dll" .\

2. .csproj anpassen

<ItemGroup>
  <None Update="libcrypto-3-x64.dll">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
  <None Update="libssl-3-x64.dll">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
</ItemGroup>

3. P/Invoke verwenden

using System.Runtime.InteropServices;
 
public static class OpenSsl
{
    [DllImport("libcrypto-3-x64.dll")]
    public static extern int OPENSSL_init_crypto(ulong opts, IntPtr settings);
}

Welche Integration passt zu Ihnen?

Anwendungstyp Empfehlung
—————————
.NET Console/WinForms/WPF P/Invoke
ASP.NET Core API P/Invoke
Blazor WebAssembly WASM Integration
Blazor Server P/Invoke
Library für andere NuGet-Paket

Weiter zu


Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional

Zuletzt geändert: den 29.01.2026 um 15:14