尝试使用 OpenSSL .NET 时出错
我已经从 openssl-net.sourceforge.net 图书馆但有麻烦。
我尝试像这样加载 private.key:
byte[] b = System.IO.File.ReadAllBytes(@"C:\SFDLL\private.key");
OpenSSL.Core.BIO bio = new OpenSSL.Core.BIO(b);
OpenSSL.Crypto.CryptoKey key = OpenSSL.Crypto.CryptoKey.FromPrivateKey(bio, "123123");
int i = 0;
并收到错误:
内部异常是
{“无法加载 DLL 'libeay32':找不到指定的模块。(HRESULT 异常:0x8007007E)”}
这不是正确的方法吗?我做错了什么?
I've downloaded the lates version of the wrapper .NET for the OpenSSL from openssl-net.sourceforge.net Library but having troubles.
I tried to load a private.key like this:
byte[] b = System.IO.File.ReadAllBytes(@"C:\SFDLL\private.key");
OpenSSL.Core.BIO bio = new OpenSSL.Core.BIO(b);
OpenSSL.Crypto.CryptoKey key = OpenSSL.Crypto.CryptoKey.FromPrivateKey(bio, "123123");
int i = 0;
and got error:
and the Inner exception is
{"Unable to load DLL 'libeay32': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
isn't this the correct way to do this? what I'm doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如错误所示,找不到
libeay32
。正如您发布的 OpenSSL.NET 链接上的安装说明所述:因此,请确保您的构建目录或系统路径中的某个位置有该 dll 的副本。
As the error says,
libeay32
can't be found. As the installation instructions state on the link you posted for OpenSSL.NET:So make sure you have a copy of that dll either in your build directory, or somewhere that is part of your system's PATH.