# openssl-net-netfx40-anycpu **Repository Path**: InkFx/openssl-net-netfx40-anycpu ## Basic Information - **Project Name**: openssl-net-netfx40-anycpu - **Description**: 原始代码: https://github.com/openssl-net/openssl-net 你可以通过 本库生成各种 数字证书 增加代码文件 __RecoverHelper.cs, 自动基于 x86 x64,释放 ssleay32.dll libeay32.dll 程序集,以实现 Any CPU - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-02-15 - **Last Updated**: 2024-10-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # openssl-net-netfx40-anycpu #### 介绍 原始代码: https://github.com/openssl-net/openssl-net 你可以通过 本库生成各种 数字证书 原库基于 .Net Framework 2.0 编译,不支持跨平台 本次基于 .Net Framework 4.0 编译,不支持跨平台 (与原库保持一致) #### LICENSE 保持原有 LICENSE #### 代码修改 1、增加代码文件 __RecoverHelper.cs, 自动基于 x86 x64,释放 ssleay32.dll libeay32.dll 程序集,以实现 Any CPU 2、原有代码逻辑 未进行修改 3、原有单元测试 全部通过 #### 单元测试截图 ![输入图片说明](%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95%E6%88%AA%E5%9B%BE_20220215_0449.png) ## 原始 README.md ------------------------------------------------ ## OpenSSL.NET (openssl-net) ### Description A managed [OpenSSL](https://www.openssl.org/) wrapper written in C# for the 2.0 .NET Framework that exposes both the [Crypto API](https://www.openssl.org/docs/crypto/crypto.html) and the [SSL API](https://www.openssl.org/docs/ssl/ssl.html). This a must for .NET developers that need crypto but don't want to use Microsoft's SSPI. This wrapper is based on version 1.0.2a of libeay32.dll and ssleay32.dll. ### Wrapper Example The following is a partial example to show the general pattern of wrapping onto the C API. Take DSA and the following C prototypes: ``` DSA * DSA_new(void); void DSA_free(DSA *dsa); int DSA_size(const DSA *dsa); int DSA_generate_key(DSA *dsa); int DSA_sign(int dummy, const unsigned char *dgst, int len, unsigned char *sigret, unsigned int *siglen, DSA *dsa); int DSA_verify(int dummy, const unsigned char *dgst, int len, const unsigned char *sigbuf, int siglen, DSA *dsa); ``` Which gets wrapped as something akin to: ``` public class DSA : IDisposable { // calls DSA_new() public DSA(); // calls DSA_free() as needed ~DSA(); // calls DSA_free() as needed public void Dispose(); // returns DSA_size() public int Size { get; } // calls DSA_generate_key() public void GenerateKeys(); // calls DSA_sign() public byte[] Sign(byte[] msg); // returns DSA_verify() public bool Verify(byte[] msg, byte[] sig); } ``` ### Installation Make sure you have `libeay32.dll` and `ssleay32.dll` in the current working directory of your application or in your `PATH`. In your .NET project, add a reference to the `ManagedOpenSsl.dll` assembly. ### Documentation Take a look at the low-level C API [documentation](https://www.openssl.org/docs). * [Install](INSTALL) * [Changes](CHANGES) ### License The OpenSSL libraries are distributed under the terms of the [OpenSSL License & SSLeay License](LICENSE); this library and related code are released under the BSD license, see [COPYING](COPYING) for more details. ### Team This library is the product of many contributors, both directly, and indirectly, thanks to the great effort of the OpenSSL team. Thanks to all those that have contributed to this project - whether code, testing, support or anything else. **Maintainer:** * Adam Caudill * Frank Laub (2006-2014) For security issues, please contact the maintainer directly prior to opening a public ticket. Security issues will receive prompt attention and be handled as quickly as possible.