.Net 和 Java 的 DSA 实现兼容吗?
我正在尝试对运行 J2ME 的移动客户端发出的请求进行数字签名,并希望通过 .Net Framework 验证签名。
有谁知道实现
DSACryptoServiceProvider //.Net
和
Signature.getInstance("SHA1withDSA", "SUN") //Java
是否兼容?或者有人有更好的主意吗?
经过一番研究,我发现这个库似乎具有适用于 C# 和 Java 的 DSA API,具有相同的底层实现: http:// www.bouncycastle.org
有人有这方面的经验吗?
I am trying to digitally sign requests made by a mobile client running J2ME and want to verify the signature by the .Net Framework.
Does anyone know if the implementations
DSACryptoServiceProvider //.Net
and
Signature.getInstance("SHA1withDSA", "SUN") //Java
are compatible? Or does anyone have a better idea?
After some research I found this library which seems to have DSA APIs for both C# and Java with the same underlying implementations: http://www.bouncycastle.org
Does anyone have any experience with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我必须处理 J2ME => .Net 网络服务。我在加密方面遇到了一些问题。据我所知,我不确定 DSA Java 和 .Net 在 DES 和 AES 加密方面有何不同。
这并不能回答你的问题,但我想它可能对你有帮助。
有一个名为 Bouncy Castle:
Releases for Java 的库:
http://www.bouncycastle.org/latest_releases.html(选择 J2ME 之一)
版本C#
http://www.bouncycastle.org/csharp/
我使用它们没有任何头痛。文档并不差,但也不好。但 Java 和 C# 版本是兼容的。
I had to deal with J2ME => .Net Web Service. And I had some problems with Encryption. I am not sure about DSA Java and .Net differs on encryption in DES and AES as far as I know.
This does not answer to your question but I guess it may help you.
There is a library named Bouncy Castle:
Releases for Java:
http://www.bouncycastle.org/latest_releases.html (pick J2ME one)
Releases for C#
http://www.bouncycastle.org/csharp/
I used them without any headache. Documentation is not poor but is not good also. But Java and C# versions are compatible.
它们必须兼容,否则 Java 和 .NET Web 服务就不会兼容,而且我确信它们是兼容的
They must be compatible, otherwise Java and .NET web-services wouldn't be, and I know for sure that they are
.NET 和 Java 以不同的方式对签名进行编码。否则它们应该是兼容的。 更多细节在另一个答案中。
.NET and Java encode the signatures in different ways. Otherwise they should be compatible. More details in another answer.
据我了解,DSA/SHA1 是标准算法(或 RFC,但没关系),因此它们很可能是可以互换的。
As I understand it, DSA/SHA1 are standard algorithms (or RFCs, but never mind), so it's more than likely they are interchangeable.