6

When we run a web server in a java card 3.0 compatible card, how can we request that server or rather at which IP address do we request that server. Further more can an android app request and get a response from the server if so how can we do it ?

vojta
  • 5,591
  • 2
  • 24
  • 64
  • I don't see any reason for casting close votes or downvotes. I find this question absolutely valid and very interesting. Have you studied Global Platform Card Networked Framework? I think it must be relevant to your question. – vojta Jan 10 '17 at 08:21
  • 3
    Is there any real Java Card 3 Extended version compatible card? or are they all virtual? – Ebrahim Ghasemi Jan 10 '17 at 19:51
  • In an emulator it runs on the localhost at default PORT 8019. Assuming such a card exists can the IP of the SIM card slot work as the localhost for the web server ? – Abhirup Ghosh Jan 10 '17 at 21:10
  • What emulator do you use? Netbeans? – vojta Jan 11 '17 at 09:07
  • Yes I use netbeans for developing javacard – Abhirup Ghosh Jan 11 '17 at 11:52

1 Answers1

5

Obviously if it isn't directly connected to a network it cannot obtain an IP address by itself (it would not be much use if it could). If there is an IP address assigned to it it must be on the host machine, routing the packets to the smart card.

Or, as the standard states in the JCRE spec of the 3.0.1 connected edition:

A Java Card Platform implementation is not required to support the TCP/IP or UDP/IP on card. Connections over HTTP, HTTPS, and TLS protocols and datagrams over the UDP protocol MAY be supported over IP, as well as non-IP protocols, by using a gateway on the terminal or hosting device. The TLS protocol MUST be supported on card.

But also:

Applications MUST NOT be required to know that a non-IP protocol is being used.

So basically the host will receive a TCP/IP stream, and convert it into packets towards the card.

Maarten Bodewes
  • 90,524
  • 13
  • 150
  • 263
  • Do you know of any application server or a web server that supports this forwarding out of the box? Or is this a gap in the stack, that must be filled in the future before real connected cards are released? – vojta Jan 11 '17 at 09:06
  • Is there any existing Android app that could work as a bridge between "localhost" in Android browser and the SIM card? – vojta Jan 11 '17 at 09:11
  • @vojta Nope, I haven't worked with the connected editions. I don't see how you can a) have an IP address and b) can do without routing on the host though so I think this is the only possible answer (I presumed this and then tried to find it in the Java Card specs, knowing that I would find it). – Maarten Bodewes Jan 11 '17 at 13:31
  • I'm putting this answer on "hold" to see if somebody knows a more authoritative answer, see also comment in bounty. – Maarten Bodewes Jan 16 '17 at 12:36
  • Where did you find that an applet can specify his own IP address? – vojta Jan 16 '17 at 15:26
  • @vojta I didn't but [a question](http://stackoverflow.com/q/41675985/589259) was posed where localhost was being used, which made me doubt my answer somewhat, so I'm not 100% certain (I'm still pretty sure that the host needs to be involved of course). I mainly kept my answer here to avoid getting an identical answer from the one I already posted. – Maarten Bodewes Jan 16 '17 at 15:50