====== 5. Integration ====== In this chapter you'll learn how to integrate OpenSSL into your .NET applications. ---- ===== Overview ===== | Topic | Description | Page | |-------|-------------|------| | P/Invoke | Integrate DLLs in .NET | [[.:dotnet-pinvoke]] | | Blazor WASM | Use WASM in browser | [[.:blazor-wasm]] | | NuGet | Create and use packages | [[.:nuget-grundlagen]] | ---- ===== Quick Start ===== ==== 1. Copy DLLs ==== # To your .NET project directory 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. Modify .csproj ==== PreserveNewest PreserveNewest ==== 3. Use P/Invoke ==== using System.Runtime.InteropServices; public static class OpenSsl { [DllImport("libcrypto-3-x64.dll")] public static extern int OPENSSL_init_crypto(ulong opts, IntPtr settings); } ---- ===== Which Integration Fits You? ===== | Application Type | Recommendation | |------------------|----------------| | .NET Console/WinForms/WPF | [[.:dotnet-pinvoke|P/Invoke]] | | ASP.NET Core API | [[.:dotnet-pinvoke|P/Invoke]] | | Blazor WebAssembly | [[.:blazor-wasm|WASM Integration]] | | Blazor Server | [[.:dotnet-pinvoke|P/Invoke]] | | Library for others | [[.:nuget-grundlagen|NuGet Package]] | ---- ===== Continue to ===== * [[.:dotnet-pinvoke|P/Invoke - Integrate DLLs]] * [[.:nuget-grundlagen|NuGet - Create Packages]] * [[.:verteilung:start|6. Distribution]] ---- //Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional//