0

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?

Manu
  • 28,753
  • 28
  • 75
  • 83

4 Answers4

1

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.

Manu
  • 28,753
  • 28
  • 75
  • 83
JCasso
  • 5,423
  • 2
  • 28
  • 42
1

They must be compatible, otherwise Java and .NET web-services wouldn't be, and I know for sure that they are

RA.
  • 1,405
  • 1
  • 11
  • 18
1

.NET and Java encode the signatures in different ways. Otherwise they should be compatible. More details in another answer.

Community
  • 1
  • 1
Rasmus Faber
  • 48,631
  • 24
  • 141
  • 189
0

As I understand it, DSA/SHA1 are standard algorithms (or RFCs, but never mind), so it's more than likely they are interchangeable.

Romain
  • 12,679
  • 3
  • 41
  • 54