将 Bouncy Castle 库与 .NET Compact Framework 结合使用
我正在尝试在 Windows Mobile 6.5 设备上使用 Bouncy Castle v1.7。
我正在尝试执行以下代码:
ISigner signer = SignerUtilities.GetSigner("SHA256withRSA");
使用 Bouncy Castle 二进制文件
在 Windows Mobile 设备上,该代码会导致引发以下异常:
“此版本的 Microsoft .NET Compact Framework 无法加载程序集系统版本,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=B77A5C561934E089。”
在经典的桌面应用程序(使用整个 .NET 框架)上,此代码运行没有问题。
所以我猜测 Bouncy Castle 和 Compact Framework 之间存在不兼容性。 然而 Bouncy Castle C# 索引页 表示“源代码现在构建在 .NET Compact 上Framework 1.0” for version 1.2
从源代码编译 Bouncy Castle
我也尝试从其源代码编译 Bouncy Castle。
我使用 Visual Studio 2008 对其进行了编译(必须转换项目并删除链接到引用但丢失的 IDEA 加密算法的类),并使用以下编译符号:NET_1_1;NETCF_2_0
当我引用编译生成的 DLL 并运行上面提到的代码(在设备上)我得到以下异常:
“找不到方法:GetSigner Org.BouncyCastle.Security.SignerUtilities。”
这看起来真的很奇怪,因为我在编码时在 Visual Studio 中获得了 IntelliSense。
有人可以告诉我如何让 Bouncy Castle 在 Compact Framework 3.5 上运行吗?
非常感谢,
克里斯托夫
I’m trying to use Bouncy Castle v1.7 on a Windows Mobile 6.5 device.
I’m trying to execute the following code:
ISigner signer = SignerUtilities.GetSigner("SHA256withRSA");
Using the Bouncy Castle binaries
On the Windows Mobile device, the code results in the following exception being thrown:
"The version of the assembly System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=B77A5C561934E089 cannot be loaded by this version of the Microsoft .NET Compact Framework."
On a classic desktop application (using the whole .NET framework), this code runs without problem.
So I’m guessing there is an incompatibility between Bouncy Castle and the Compact Framework.
However the Bouncy Castle C# index page says “Source now builds on .NET Compact Framework 1.0” for version 1.2
Compiling Bouncy Castle from source-code
I've also tried to compile Bouncy Castle from its source-code.
I've compile it using Visual Studio 2008 (had to convert the project and remove classes linked to the IDEA encryption algorithm that were referenced but missing) with the following compilation symbols: NET_1_1;NETCF_2_0
When I reference the DLL resulting from the compilation and run the code mentioned above (on a Device) I get the following exception:
"Method not found: GetSigner Org.BouncyCastle.Security.SignerUtilities."
This seems really strange since I get IntelliSense in Visual Studio while coding.
Can someone tell me how to get Bouncy Castle running on Compact Framework 3.5 ?
Thanks a lot,
Christophe
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我创建了所需的文件,并将 SLN/CSPROJ 文件放在我的博客上< /a>.我创建了一个非常简单的测试应用程序,它成功创建了 ISigner 实现实例。这是我的消费者代码:
I created the required files and put the SLN/CSPROJ files up on my blog. I created a very simple test app that successfully created an ISigner implementation instance. This was my consumer code: