Inhaltsverzeichnis
5. Integrazione
In questo capitolo imparerete come integrare OpenSSL nelle vostre applicazioni .NET.
Panoramica
| Argomento | Descrizione | Pagina |
| ———– | ————- | ——– |
| P/Invoke | Incorporare DLL in .NET | 5.1 P/Invoke - Incorporare DLL |
| Blazor WASM | Usare WASM nel browser | blazor-wasm |
| NuGet | Creare e usare pacchetti | 5.2 Fondamenti NuGet |
Avvio Rapido
1. Copiare le DLL
# Nella directory del progetto .NET 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. Modificare .csproj
<ItemGroup> <None Update="libcrypto-3-x64.dll"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> <None Update="libssl-3-x64.dll"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup>
3. Usare 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); }
Quale Integrazione Fa per Voi?
| Tipo di Applicazione | Consigliato |
| ———————- | ————- |
| .NET Console/WinForms/WPF | P/Invoke |
| ASP.NET Core API | P/Invoke |
| Blazor WebAssembly | Integrazione WASM |
| Blazor Server | P/Invoke |
| Libreria per altri | Pacchetto NuGet |
Continua con
Wolfgang van der Stille @ EMSR DATA d.o.o. - Post-Quantum Cryptography Professional
Zuletzt geändert: il 29/01/2026 alle 21:38