3

I need to transfer byte array from my java app to a c# app. One option is just store it into a file but its not so secure. I was thinking maybe there is a way to use a memorystream or something so the data wont be stored anywhere else than memory.

EDIT: Just to give more information. Applications run on the same machine and C# applications is executing the java application.

hs2d
  • 6,027
  • 24
  • 64
  • 103
  • You can encrypt the data written to the file and insert hashcodes to prevent tampering of the data. – codymanix Mar 17 '11 at 14:01
  • The data is a private key so its encrypted with other key for security reasons anyway for exporting it. What i need to do now is to transfere that encrypted key to the c# with the key i used to encrypt it. – hs2d Mar 17 '11 at 14:04

3 Answers3

1

You can expose methods in a way that will allow the two application to speak to each other. Here is a similar question with numerous answers.

Community
  • 1
  • 1
Josh M.
  • 26,437
  • 24
  • 119
  • 200
  • There are numerous other suggestions on the page I linked, I'm sure one of them can work for you. – Josh M. Mar 17 '11 at 13:44
1

If you are only transferring a byte array between programs on the same computer, using a socket could be easiest to implement.

The down side is you will need to ensure the listening server socket doesn't accept connections from any other hosts (bind to localhost only).

The most secure way to do this is via shared memory.

Community
  • 1
  • 1
Gareth Davis
  • 27,701
  • 12
  • 73
  • 106
0

WebService can be a choice for communication between heterogeneous platforms.

卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130